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 / shravya poojitha

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,root;
float x1,x2;
printf("enter the roots a,b,c");
scanf("%d %d %d",&a,&b,&c);
if(a=0&&b=0)
printf("no solution");
else
if(a=0)
{
root=-c/b;
printf("root=%d",root);
}
else
if[(b*b-4*a*c)>0]
{
x1=[-b+sqrt (b*b-4*a*c)]/(2*a);
x2=[-b-sqrt (b*b-4*a*c)]/(2*a);
printf("the roots are x1=%f,x2=%f",x1,x2);
}
else
printf("it has imaginary roots");
getch();
}

Is This Answer Correct ?    142 Yes 49 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I do serial ("comm") port I/O?

1180


What is null pointer constant?

1153


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2067


what are the 10 different models of writing an addition program in C language?

1893


Is there anything like an ifdef for typedefs?

1147


What is actual argument?

1060


Explain threaded binary trees?

1157


What is strcpy() function?

1139


Describe the order of precedence with regards to operators in C.

1047


What's the total generic pointer type?

1052


What is a class c rental property?

1089


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1915


How is a structure member accessed?

1127


What is meant by realloc()?

1138


Do pointers store the address of value or the actual value of a variable?

1077