#include<stdio.h>
#include<math.h>
//code by rajendra
main(){
int a,b,c,d;
float root1,root2;
printf("enter the coefficient of a,b,c \n");
scanf("%d%d%d",&a,&b,&c);
d=b*b-4*a*c;
if(d>0){
root1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf("first root is = %f and second root is = %f\n",root1,root2);
}
else
printf("root are imaginory");
}
#include<math.h>
//code by rajendra
main(){
int a,b,c,d;
float root1,root2;
printf("enter the coefficient of a,b,c \n");
scanf("%d%d%d",&a,&b,&c);
d=b*b-4*a*c;
if(d>0){
root1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf("first root is = %f and second root is = %f\n",root1,root2);
}
else
printf("root are imaginory");
}
No comments:
Post a Comment