program to find the roots of a quardratic equation
Answer / valli
/***********
quadratic equationis ax^2+bx+c=0
************8/
#include<math.h>
main()
{
int a,b,c,d,r1,r2;
printf("enter the values of a,b,c");
scanf("%d%d%d",&a,&b,&c)'
d=(b*b)-(4*a*c);
if(d<0)
{
printf("the roots are imaginary");
d=sqrt(-d);
printf("\nroots are %d+i%d",-b/(2*a),d/(2*a));
printf("\n%d-i%d",-b/(2*a),d/(2*a));
}
else
{
d=sqrt(d);
r1=(-b+d)/(2*a);
r2=(-b-d)/(2*a);
printf("the roots of the equation are %d %d ",r1,r2);
}
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Difference between MAC vs. IP Addressing
what about "char *(*(*a[])())();"
define switch statement?
What is && in c programming?
Can I pass constant values to functions which accept structure arguments?
What does 2n 4c mean?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What is structure padding & expalain wid example what is bit wise structure?
Whether there can be main inside another main?If so how does it work?
plz answer..... a program that reads non-negative integer and computes and prints its factorial
What are multibyte characters?
What are global variables?