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 |
Are negative numbers true in c?
In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?
What is return type in c?
What is advantage of pointer in c?
what is the difference between malloc() and calloc() function?
Is c compiled or interpreted?
Where are c variables stored in memory?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
how to execute with out main in cprogram
What are 3 types of structures?
Which one would you prefer - a macro or a function?
Find if a number is power of two or not?