Jaume Cuadrat Realp has written:
'Cogul' -- subject(s): Fiction, History
The population of Realp is 1,212.
Realp railway station was created in 1926.
#include<stdio.h> #include<conio.h> void main() { float a,b,c,z,d,x,y; clrscr(); printf("Enter the value of a,b,c"); scanf("%f %f %f",&a,&b,&c); d=((b*b)-(4*a*c)); z=sqrt(d); x=(-b+z)/(2*a); y=(-b+z)/(2*a); printf("The Quadratic equation is x=%f and y=%f",x,y); getch(); } This answer does not think about imaginary roots. I am a beginner in C programming. There might be flaws in my code. But, it does well. the code is #include<stdio.h> #include<math.h> main() { float a, b, c; float dis, sqdis, real, imag, root1, root2; printf("This program calculates two roots of quadratic equation of the form ax2+bx+c=0.\n"); printf("\n"); printf(" please type the coefficients a, b and c\n"); printf("\n"); printf("a = "); scanf("%f", &a); printf("\n"); printf("b = "); scanf("%f", &b); printf("\n"); printf("c = "); scanf("%f", &c); printf("\n"); dis = (b*b-4*a*c); if(dis < 0) { sqdis = sqrt(-dis); real = -b/(2*a); imag = sqdis/(2*a); printf(" The roots of the quadratic equations are \n x1\t=\t %f + %f i\n x2\t=\t %f - %f i\n", real, imag, real, imag); } else { sqdis = sqrt(dis); root1 = -b/(2*a)+sqdis/(2*a); root2 = -b/(2*a)-sqdis/(2*a); printf("The two roots of the quadratic equations are %f and %f.\n", root1, root2); } system("pause"); }