मराठी

Draw the Flowchart for Finding the Roots of Quadratic Equation. Write Program for Same.

Advertisements

प्रश्न

Draw the flowchart for finding the roots of quadratic equation. Write program for same. 

Advertisements

उत्तर

}
else if (discriminant == 0)
{
    r1 = r2 = -b/(2*a);
    printf("r1 = r2 = %.2lf;", r1);
}
else
{
   rp = -b/(2*a);
   ip = sqrt(-discriminant)/(2*a);
   printf("r1 = %.2lf+%.2lfi and r2 = %.2f-%.2fi", rp, ip, rp, ip);
}
return 0;
}

 

Output:
Enter coefficients a, b and c: 2.3
4
5.6
Roots are: -0.87+1.30i and -0.87-1.30i
shaalaa.com
Three Construct of Algorithm and Flowchart
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2018-2019 (December) CBCGS
Advertisements
Share
Notifications



      Forgot password?
Course
Use app×