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...

Develop a flow chart and write a c program to find the roots
of a quadratic equation ax2+bx+c=0 using switch and break
statement.

Answer Posted / naveen kumar.gembali

#include<stdio.h>
#include<conio.h>
main()
{
float a,b,c,r1,r2,d;
printf("enter a,b,c values");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if(d>0)
{
printf("the roots are real and unequal");
r1=(-b-sqrtd)/2*a;
r2=(-b+sqrtd)/2*a;
printf("the roots are %f%f",r1,r2);
}
else
if(d=0)
{
printf("the roots are real and equal");
r1=-b/2*a;
r2=r1;
printf("the roots are %f%f",r1,r2);
}
elseif(d<0)
{
printf("the roots are imaginary");
}
getch();
}
@naveenkumar.gembali@

Is This Answer Correct ?    8 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are enums in c?

1211


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1108


What happens if header file is included twice?

1154


What is adt in c programming?

1172


What is dynamic variable in c?

1040


What do the functions atoi(), itoa() and gcvt() do?

1197


Explain bit masking in c?

1145


code for replace tabs with equivalent number of blanks

2167


How do you list files in a directory?

1149


Tell me what are bitwise shift operators?

1135


Can you write the function prototype, definition and mention the other requirements.

1146


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1990


What is the meaning of ?

1042


What is the advantage of an array over individual variables?

1243


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1029