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 |
wat is the difference between array and pointer?
what is the use of keyword volatile??
What does int main () mean?
how can we Declare a variable in c without defining it.
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }
plz answer..... a program that reads non-negative integer and computes and prints its factorial
What is the use of typedef in c?
What is %d used for?
What are header files in c programming?
int a=20; int b=30; int c=40; printf("%d%d%d"); what will be the output?
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.