![]() |
|||
Comments and Discussions
|
About Article
Alternative to A simple program to solve quadratic equations with
Simple and prints imaginary roots too!float a,b,c,x1,x2,d,dsq;printf("ax^2 + bx + c = 0");printf("\nEnter a,b,c separated by commas : \n");scanf("%f,%f,%f",&a,&b,&c);d = b*b-(4*a*c);if(d>=0){dsq=sqrt(d);x1 = (-b+dsq)/(2*a);x2 = (-b-(dsq))/(2*a);printf("\nRoot 1 : %f\nRoot 2...
Top News
Old Japanese Man Creates Amazing Art Using Excel (Wait, Excel?) Get the Insider News free each morning.Related Videos
Related Articles
|
||||||||||||||||||||||||||||||||||||