rupesh ranjan


{ City } noida
< Country > india
* Profession * senior software engineer
User No # 104694
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 32
Users Marked my Answers as Wrong # 41
Questions / { rupesh ranjan }
Questions Answers Category Views Company eMail




Answers / { rupesh ranjan }

Question { CSC, 43553 }

write a c program to find the roots of a quadratic equation
ax2 + bx + c = 0


Answer

#include
#include
void main()
{
int a, b, c;
float x1, x2, root, d;
clrscr();
printf("Enter the values of a, b & c");
scanf("%d %d %d", &a, &b, &c);
if(a==0 && b==0)
printf("There izz no Soln...");
else
if(a=0)
{
root= -c/b;
printf("root = %d", root);
}
else
d = b*b-4*a*c;
if(d>=0)
{
x1 = (-b + d)/2*a;
x2 = (-b - d)/2*a;
printf("Roots are....x1 = %f, x2 = %f\n", x1,x2);
}
else
printf("Given Eqn has imaginary roots");
getch();
}

Is This Answer Correct ?    32 Yes 41 No