#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{
int a,b,c,x1,x2,d;
clrscr();
printf("Enter three value: ");
scanf("%d %d %d",&a,&b,&c);
d=sqrt((b*b)-(4*a*c));
if(d>0)
{
x1=(-b+d)/(2*a);
x2=(-b-d)/(2*a);
printf("x= %d, %d",x1,x2);
}
else
{
printf("Your entered value is incorrect %d",d);
}
getch();
}
#include <conio.h>
#include <math.h>
void main()
{
int a,b,c,x1,x2,d;
clrscr();
printf("Enter three value: ");
scanf("%d %d %d",&a,&b,&c);
d=sqrt((b*b)-(4*a*c));
if(d>0)
{
x1=(-b+d)/(2*a);
x2=(-b-d)/(2*a);
printf("x= %d, %d",x1,x2);
}
else
{
printf("Your entered value is incorrect %d",d);
}
getch();
}
No comments:
Post a Comment