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

Explain what is gets() function?

1118


What is the difference between memcpy and memmove?

1085


How can you convert integers to binary or hexadecimal?

1072


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2498


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1149


Explain null pointer.

1193


What is #line in c?

1074


How can I write a function analogous to scanf?

1232


What are pointers? What are different types of pointers?

1219


write a program in c language to print your bio-data on the screen by using functions.

6839


Difference between strcpy() and memcpy() function?

1209


What are the advantages of c language?

1149


Explain the properties of union. What is the size of a union variable

1248


Why flag is used in c?

1181


What is the purpose of 'register' keyword?

1134