write a c program to find the roots of a quadratic equation
ax2 + bx + c = 0
Answers were Sorted based on User's Feedback
#include<stdio.h>
#include<conio.h>
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 |
write a program to gat the digt sum of a number (et. 15= >1+5=6)
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above
Is c functional or procedural?
how many argument we can pas in in a function
how can make variable not in registers
Explain what is wrong in this statement?
why you will give me a job in TCS.
Which is the best website to learn c programming?
What is the full form of getch?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Where can I get an ansi-compatible lint?
Suggesting that there can be 62 seconds in a minute?