Wednesday, 6 September 2017

C++ Program to calculate the greatest of three numbers using nested if-else


In the above program, the user entered the values of three numbers a,b&c. First condition is checked (a>b). If this condition is true then comes to condition (a>c). If condition (a>c) is true then first number __ is greatest is print otherwise third number __ is greatest is print.

But if the condition (a>b) is false then it checks for the condition (b>c) . If condition (b>c) is true then second number __ is greatest is print otherwise third number __ is greatest is print.


for any other queries comment below....

No comments:

Post a Comment

Nested If-else : To find the roots of quadratic equation ax2+bx+c=0 and a!=0

let ax 2 +bx+c=0 : is a quadratic equation output:             Enter the values of a,b,c : 1 -5 6             roots are x1=3  x3=...