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 |
What is the right type to use for boolean values in c?
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3
WRITE A C PROGRAM FOR PRINT "RHOMBUS" STRUCTURE . Example: Enter the numbers :3 * * * * * * * *
What is the explanation for prototype function in c?
What is the difference between constant pointer and pointer to a constant. Give examples.
ASCII stands for
Why is #define used?
Why c is known as a mother language?
Write a code to generate divisors of an integer?
Explain the difference between call by value and call by reference in c language?
write a programe to find the factorial of given number using recursion