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 |
What is void main () in c?
Why preprocessor should come before source code?
why little endian and big endian came?y they using differently? y they not used commonly ?wt is application of little and big ?
What's wrong with "char *p; *p = malloc(10);"?
what is the difference between strcpy() and memcpy() function?
What is the explanation for the dangling pointer in c?
Write a Program to find whether the given number or string is palindrome.
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?
what are bit fields in c?
What are the advantages and disadvantages of a heap?
What are the uses of a pointer?