Posts

Showing posts with the label Labs Programs

Program To Calculate Quadratic Equation

Image
  Quadratic Equation        Algorithm Step1 : Start Step2 : Read a, b, c values Step3 :Compute d = b2 4ac            if d > 0 then           r1 = b+ sqrt (d)/(2*a)            r2 = b sqrt(d)/(2*a)       Otherwise if                 d = 0 then               compute r1 = -b/2a, r2=-b/2a                 print r1,r2 values           Otherwise if                    d < 0 then print roots are imaginary Step4 : Stop    Flow Chart      Code # include # include int main (){ float a,b,c,r1,r2,D; printf ("enter the values of a b c :\n"); scanf (" %f %f %f", &a, &b, &c); D= b*b-4*a*c; if (D>0){...