#include
#include
#include
void main()
{
int a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3,m1,n1,o1,p1,q1,r1,s1,t1,m2;
int n2,o2,p2,q3,r3,s3,t3;
clrscr();
printf("\n\nEnter first equation: ");
scanf("%d %*c %d %*c %d %*c %*c %d",&a1,&b1,&c1,&d1);
printf("\n\nEnter second equation: ");
scanf("%d%*c%d%*c%d%*c%*c%d",&a2,&b2,&c2,&d2);
printf("\n\nEnter third equation: ");
scanf("%d%*c%d%*c%d%*c%*c%d",&a3,&b3,&c3,&d3);
delay(500);
printf("\n\nThe equation are :");
printf("\n\n %dX %dY %dZ=%d",a1,b1,c1,d1);
printf("\n\n %dX %dY %dZ=%d",a2,b2,c2,d2);
printf("\n\n %dX %dY %dZ=%d",a3,b3,c3,d3);
m1=a1*a2;n1=b1*a2;o1=c1*a2;p1=d1*a2;
m2=a1*a2;n2=b2*a1;o2=c2*a1;p2=d2*a1;
q1=a1*a3;r1=b1*a3;s1=c1*a3;t1=d1*a3;
q3=a3*a1;r3=b3*a1;s3=c3*a1;t3=d3*a1;
if(m1!=m2)
{
b2=n1+n2;
c2=o1+o2;
d2=p1+p2;
}
else
{
b2=n1-n2;
c2=o1-o2;
d2=p1-p2;
}
if(q1!=q3)
{
b3=r1+r3;
c3=s1+s3;
d3=t1+t3;
}
else
{
b3=r1-r3;
c3=s1-s3;
d3=t1-t3;
}
delay(500);
printf("\n\nThe equation are :");
printf("\n\n %dX %dY %dZ=%d",a1,b1,c1,d1);
printf("\n\n %dY %dZ=%d",b2,c2,d2);
printf("\n\n %dY %dZ=%d",b3,c3,d3);
m1=a1*b2;n1=b1*b2;o1=c1*b2;p1=d1*b2;
n2=b2*b1;o2=c2*b1;p2=d2*b1;
if(n1!=n2)
{
a1=m1;
c1=o1+o2;
d1=p1+p2;
}
else
{
a1=m1;
c1=o1-o2;
d1=p1-p2;
}
n2=b2*b3;o2=c2*b3;p2=d2*b3;
r3=b3*b2;s3=c3*b2; t3=d3*b2;
if(n2!=r3)
{ c3=o2+s3;
d3=p2+t3;
}
else
{
c3=o2-s3;
d3=p2-t3;
}
delay(500);
printf("\n\nThe equation are:");
printf("\n\n %dX %dZ=%d",a1,c1,d1);
printf("\n\n %dY %dZ=%d",b2,c2,d2);
printf("\n\n %dZ=%d",c3,d3);
int z=d3/c3;
int x=(d1-(c1*z))/a1;
int y=(d2-(c2*z))/b2;
delay(500);
printf("\nThe root of this equqtions: ");
printf(" X=%d Y=%d Z=%d",x,y,z);
getch();
}
0 comments:
Post a Comment