Search & Find out

Thursday, December 3, 2009

Cramers Rule

#include "stdio.h"
#include "conio.h"

void main()
{
float a1,a2,a3,b1,b2,b3,d1,d2,d3,D,Dx,Dy,Dz,x,y,z,c1,c2,c3;
clrscr();

printf("Welcome to CRAMERS RULE\n\n");
printf("Enter value of a1,b1,c1,d1.");
scanf("%f%f%f%f",&a1,&b1,&c1,&d1);
printf("Enter value of a2,b2,c2,d2.");
scanf("%f%f%f%f",&a2,&b2,&c2,&d2);
printf("Enter value of a3,b3,c3,d3.");
scanf("%f%f%f%f",&a3,&b3,&c3,&d3);
D=(a1*((b2*c3)-(c2*b3)))-(b1*((a2*c3)-(c2*a3)))+(c1*((a2*b3)-(b2*a3)));
Dx=d1*(b2*c3-c2*b3)-b1*(d2*c3-c2*d3)+c1*(d2*b3-b2*d3);
Dy=a1*(d2*c3-c2*d3)-d1*(a2*c3-c2*a3)+c1*(a2*d3-d2*a3);
Dz=a1*(b2*d3-d2*b3)-b1*(a2*d3-d2*a3)+d1*(a2*b3-b2*a3);
x=(Dx)/D;
y=(Dy)/D;
z=(Dz)/D;
printf("\n\nx=%f,\ny=%f,\nz=%f\n",x,y,z);
getch();
}





Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use