#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a=1,b=-10,c=34;
double
q,m,h,x,y,f,g;
x=b*b-4*a*c;
printf(“Value of x
is %1f\n”,x);
m=(double)x;
if(x>=0)
h=sqrt(m);
else{
q=-m;
h=sqrt(m);
}
printf(“Square root
is %1f\n”,n);
if(x>=0)
{
x=(-b+h)/(z*a);
y=(-b-h)/(z*a);
printf(“\nAnswer
is %1f and %1f\n”,x,y);
}
else
{
f=b/(z*a);
g=h/(z*a);
printf(“1st
Root is %1f +i %1f \n”,f,g);
printf(“2nd
Root is %1f -i %1f \n”,f,g);
}
getch();
}
OUTPUT :
Value of x is -36
Value of y is 6
1st Root is 5+3i
2nd Root if 5-3i
0 comments:
Post a Comment