We are hiring content writers to work from home

Resources » Articles/Knowledge Sharing » Computer & Technology

# C Program for Quadratic equation

 Posted Date: 18-Jun-2008 Last Updated: 18-Jun-2008 Category: Computer & Technology Author: J.Jerome Jernix Member Level: Silver Points: 2

#include
void main()
{
int a,b,c,d,e,f,g;
clrscr();
printf(“Enter the three values”);
scanf(“%d%d%d”,&a&b&c);
d=((b*b)-(4*a*c));
if(d==0)
{
printf(“Roots are real and equal”);
f=-b/(2*a);
printf(“x1=%d\nx2=%d”,f,f”);
}
else if(d>0)
{
printf(“Roots are real and distinct”);
e=sqrt(d);
f=(-b+e)/(2*a);
g=(-b-e)/(2*a);
printf(“x1=%d\nx2=%d”,f,g);
}
else
{
printf(“Roots are imaginary”);
d=-d;
e=sqrt(d);
f=-b/(2*a);
g=e/(2*a);
printf(“x1=%d+%d\nx2%d-%d”,f,g,f,g);
}
getch();
}

Did you like this resource? Share it with your friends and show your love!

Responses to "C Program for Quadratic equation"

No responses found. Be the first to respond...

Feedbacks

## Post Comment:

• Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
• No HTML formatting and links to other web sites are allowed.
• This is a strictly moderated site. Absolutely no spam allowed.
•  Name: Sign In to fill automatically. Email: (Will not be published, but required to validate comment) Type the numbers and letters shown on the left.

 Next Resource: C++ Program for Multiple Inheritance Previous Resource: Java Program-For stack Return to Resources Post New Resource Category: Computer & Technology

Post resources and earn money!

More Resources
 Popular Tags Tag posting guidelines Search Tags

### Subscribe to Email

• Get Jobs by Email
• Forum posts by Email
• Articles by Email