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 / 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 |
IS Doon college of Engn.. has good faculty
Difference between pass by reference and pass by value?
What is volatile keyword in c?
Explain how can I manipulate strings of multibyte characters?
write a C and C++ programme to implement the A,bubble sort B,quick sort C,insertion sort D,sequential search E,binary search
Explain the binary height balanced tree?
enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above
What are disadvantages of C language.
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Hai what is the different types of versions and their differences
how many argument we can pas in in a function
What are the different types of linkage exist in c?