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 scanf_s in c?

0 Answers  


What is the use of the function in c?

0 Answers  


Discuss the function of conditional operator, size of operator and comma operator with examples.

0 Answers   TCS,


plssssss help !!....using array.. turbo c.. create a program that will accept number of words to be consored. .a word must not exceed 10 characters long .the text to be entered will be no longer than 200 characters .there will be no 10 words example: enter number of words to be censor: 5 enter words to censor: windows office microsoft bill gates enter text to censor: bill gates founded microsoft and makes office and windows sample output: <consored> <censored> founded <censored> and makes <censored> and <censored>

1 Answers  


main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  






Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

0 Answers  


What is the best way to comment out a section of code that contains comments?

0 Answers  


What is the mean of function?

0 Answers  


What are the different types of control structures in programming?

0 Answers  


What is difference between structure and union in c?

0 Answers  


The operation of a stair case switch best explains the a) or operation b) and operation c)exclusive nor operation d)exclusive or operation Which of the following is/are syntactically correct? a) for(); b) for(;); c) for(,); d) for(;;);

1 Answers   HCL, Public Service Commission,


Which is an example of a structural homology?

0 Answers  


Categories