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 / adde.c

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float a,b,c,x1,x2,y,z;
printf("Please Enter 3 inputs of a,b,c in This
format:a<space>b<space>c=");
scanf("%f%f%f",&a,&b,&c);
y=(b*b-4*a*c);
if(a==0&&b==0)
{
printf("There is No Solution!!!!");
}
else if(a==0&&b!=0)
{
x1=(-1)*c/b;
printf("x1=%f",x1);
}
else
{
if(y>=0)
{
z=sqrt(y);
x1=((-1)*b+z)/(2*a);
x2=((-1)*b-z)/(2*a);
printf("Value of x1=%f & x2=%f",x1,x2);
}
else
{
printf("Your Equiation Showing an imaginery
value.....!!!!!!");
}
}
getch();
}

Is This Answer Correct ?    12 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why void main is used in c?

999


Explain why can’t constant values be used to define an array’s initial size?

1305


What does & mean in scanf?

1043


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2077


What is static and volatile in c?

1172


What are qualifiers and modifiers c?

940


Give basis knowledge of web designing ...

1981


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

1131


can any one provide me the notes of data structure for ignou cs-62 paper

2118


How many keywords are there in c?

1021


Why isnt any of this standardized in c?

1020


Can we declare variable anywhere in c?

921


Why do we use main function?

1112


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

2018


What does the && operator do in a program code?

1159