Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a c program to find the roots of a quadratic equation
ax2 + bx + c = 0

Answer Posted / rupesh

#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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1987


What's the best way of making my program efficient?

1052


What is the difference between if else and switchstatement

1882


Describe newline escape sequence with a sample program?

1087


I need previous papers of CSC.......plz help out by posting them.......

2262


Linked lists -- can you tell me how to check whether a linked list is circular?

1043


What are local static variables? How can you use them?

1101


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2314


Why is c called "mother" language?

1245


What is a sequential access file?

1123


Are the expressions * ptr ++ and ++ * ptr same?

1104


What is build process in c?

1103


What is calloc in c?

1095


What is wrong with this statement? Myname = 'robin';

1289


Is it possible to pass an entire structure to functions?

959