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 |
Print all the palindrome numbers.If a number is not palindrome make it one by attaching the reverse to it. eg:123 output:123321 (or) 12321
In c language can we compile a program without main() function?
Is fortran still used in 2018?
1. Write the function int countchtr(char string[ ], int ch); which returns the number of times the character ch appears in the string. Example, the call countchtr(“She lives in NEWYORK”, ‘e’) would return 3.
Explain what are header files and explain what are its uses in c programming?
What is the best way of making my program efficient?
How can you tell whether two strings are the same?
write a program of palindrome(madam=madam) using pointer?
What is meant by int main ()?
which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....
what is the meaning of 'c' language
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }