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.



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

Answer / 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

More C Interview Questions

What is void main () in c?

0 Answers  


Why preprocessor should come before source code?

2 Answers  


why little endian and big endian came?y they using differently? y they not used commonly ?wt is application of little and big ?

1 Answers  


What's wrong with "char *p; *p = malloc(10);"?

5 Answers  


what is the difference between strcpy() and memcpy() function?

2 Answers  


What is the explanation for the dangling pointer in c?

0 Answers  


Write a Program to find whether the given number or string is palindrome.

0 Answers   InterGraph,


1.)how to find d most repeated word in a string? string ="how do you do"?? output should be do

1 Answers   AAS, Nagarro, Vuram,


What is a char c?

0 Answers  


what are bit fields in c?

2 Answers  


What are the advantages and disadvantages of a heap?

0 Answers  


What are the uses of a pointer?

0 Answers  


Categories