Saturday, 2 March 2019

A set of two linear eqn and find x1 and x2.

#include<stdio.h>
main()
{
int a,b,c,d,m,n;
float x1,x2;
printf("Enter the value of a,b,c,d,m,n:");
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&m,&n);
if((a*d-c*b)!=0)
{
x1=(m*d-b*n)/(a*d-c*b);
x2=(n*a-m*c)/(a*d-c*b);
printf("\n The value of x1=%f\n The value of x2=%f",x1,x2);
}
else
printf("The division is not possible and result is an abrupt value");
}

No comments:

Post a Comment