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 |
Reverse the part of the number which is present from position i to j. Print the new number.[without using the array] eg: num=789876 i=2 j=5 778986
What does s c mean in text?
Explain how do you determine whether to use a stream function or a low-level function?
What does c mean in basketball?
How can you return multiple values from a function?
What are global variables and explain how do you declare them?
What is a c token and types of c tokens?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What does struct node * mean?
What is restrict keyword in c?
What are the different flags in C? And how they are useful? And give example for each in different consequences?
What is the use of in c?