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 |
Write a program for print infinite numbers
What is binary tree in c?
How do you determine the length of a string value that was stored in a variable?
What are the types of i/o functions?
Does sprintf put null character?
What is a 'null pointer assignment' error?
WRITE A PROGRAM TO FIND A REVERSE OF TWO NO
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What is the purpose of the statement: strcat (S2, S1)?
Write a program which returns the first non repetitive character in the string?
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%
Explain the difference between struct and union.