Write a C program to find the roots of a quadratic equation.
#include<stdio.h> #include<conio.h> #include<math.h> void main() { float a,b,c,d,r1,r2,imp,rp; clrscr(); printf(“Enter a,b,c:”); scanf(“%f%f%f”,&a,&b,&c); d=b*b-4.0*a*c; if(d==0) { printf(“roots are real and equal”); r1=-b/2*a; r2=r1; printf(“root1=%f”,r1); printf(“root2=%f”,r2); } else if(d>0) { printf(“roots are real and unequal”); r1=(-b+sqrt(d))/2*a; r2=(-b-sqrt(d))/2*a; printf(“root1=%f”,r1); printf(“root2=%f”,r2); } else if(d<0) { d=-d; printf(“roots are complex”); rp=-b/2*a; imp=sqrt(d)/2*a; printf(“root1=%f+i%f”,rp,imp); printf(“root2=%f-i%f”,rp,imp); } getch(); }
Write a C program to print the following pattern output.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Write a C program to print the following output.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Write short notes on:
What are the methodology for dialog design?
Convert the Regular Expression into e-NFA and then corresponding DFA.
Write short notes on:
Write a C program to convert Centigrade temp into Farenhite temp.