Jump to content

Roots of an equation: Difference between revisions

From IdeaWazaWiki
wikademia>Remi
m Roots of an Equation moved to Roots of an equation: naming conventions
wikademia>Wikademia
m 5 revisions
 
(No difference)

Latest revision as of 20:53, 11 May 2009

<source lang="c">//solution of degree 2 eqn

  1. include<stdio.h>
  2. include<conio.h>

void main() {

 float a1,b1,c1,a2,b2,c2,x,y;
 clrscr();
 printf("enter co-eff's of both the equations");
 scanf("%f%f%f%f%f%f",&a1,&b1,&c1,&a2,&b2,&c2);
 y=((c2*a1)-(c1*a2))/((a1*b2)-(a2*b1));
 x=((c1*b2)-(c2*b1))/((a1*b2)-(a2*b1));
 printf("x=%f\n y=%f\n",x,y);
 getch();

} </source>