Two-stroke samikarana program
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float a,b,c,d,R1,R2;
printf("\n a,b,c=? \n");
scanf("%f%f%f",&a,&b,&c);
D=b*b-4*a*c;
if(D>0)
{
printf("\n Roots are real.\n");
R1=(-b+sqrt(D))/(2.0*a);
R2=(-b-sqrt(D))/(2.0*a);
printf("\n Root1=%.2f\t Root2=%.2f",R1,R2);
}
else
printf("Roots are imaginary.");
getch();
}
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float a,b,c,d,R1,R2;
printf("\n a,b,c=? \n");
scanf("%f%f%f",&a,&b,&c);
D=b*b-4*a*c;
if(D>0)
{
printf("\n Roots are real.\n");
R1=(-b+sqrt(D))/(2.0*a);
R2=(-b-sqrt(D))/(2.0*a);
printf("\n Root1=%.2f\t Root2=%.2f",R1,R2);
}
else
printf("Roots are imaginary.");
getch();
}
No comments:
Post a Comment
Thank you for visit this site. You will get many programming news from here and learn programming very easily.