Saturday 16 September 2017

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



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


In the above program, a,b,c are the coefficient of quadratic equation. We calculate the discriminant d=b2-4ac. Then using nested if-else statement.

for any 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=...