Introduction to C language
Program to find Roots of a quadratic equations




/*roots of a quadratic equation*/
‡include<math.h>
main()
{
int a,b,c,x,y,d;
clrscr();
printf("\nEnter a,b and c values:");
scanf("%d%d%d",&a,&b,&c);
d=(b*b)-(4*a*c);
x=(-b+sqrt(d))/(2*a);
y=(-b-sqrt(d))/(2*a);
printf("\n x : %d",x);
printf("\n y : %d",y);
getch();
}



 
-----------------------------------------------------------------------------------------
please mail comments to vgdarur@gmail.com
 

 

www.iforerunner.com