Skip to main content

Posts

Showing posts with the label C programming

Calculate Quadratic equation in c language

Simple program to get Quadratic equation in c language #include< stdio.h> #include< math.h> int main(){ float a,b,c; float d,root1,root2; printf("Enter a, b and c of quadratic equation: "); scanf("%f%f%f",&a,&b,&c); d = b * b - 4 * a * c; if(d Sample output: Enter a, b and c of quadratic equation: 2 4 1 The roots are real numbers. The roots of quadratic equation are: -0.293, -1.707