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
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What are formal parameters?
How to delete a node from linked list w/o using collectons?
What does %d do in c?
What is #line?
What is difference between scanf and gets?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What are 'near' and 'far' pointers?
What is the -> in c?
What is getch () for?
Explain what math functions are available for integers? For floating point?
What is the difference between test design and test case design?
When can a far pointer be used?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
differentiate built-in functions and user – defined functions.