===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
float a1,a2,b1,b2,c1,c2,a,b,p,q,z,s,x,y;
gotoxy(32,1);
cprintf("Linear Equations");
gotoxy(10,3);
cprintf("( )x + ( )y = ");
gotoxy(11,3);
cscanf("%f",&a);
gotoxy(19,3);
cscanf("%f",&b);
gotoxy(26,3);
cscanf("%f",&z);
gotoxy(50,3);
cprintf("( )x + ( )y = ");
gotoxy(51,3);
cscanf("%f",&p);
gotoxy(59,3);
cscanf("%f",&q);
gotoxy(66,3);
cscanf("%f",&s);
if(a/p==b/q && a/p==z/s)
{
gotoxy(30,5);
cprintf("Co-incident Lines");
gotoxy(30,6);
cprintf("Infinite solution");
}
else if(a/p==b/q && a/p!=z/s)
{
gotoxy(33,5);
cprintf("Parallel Lines");
gotoxy(35,6);
cprintf("No solution");
}
else if(a/p!=b/q)
{
a1=p*a;
b1=p*b;
c1=p*z;
a2=a*p;
b2=a*q;
c2=a*s;
y=(c1-c2)/(b1-b2);
b1=b1*y;
x=(c1-b1)/a1;
gotoxy(35,5);
cprintf("x= %.2f",x);
gotoxy(35,6);
cprintf("y= %.2f",y);
}
getch();
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
float a1,a2,b1,b2,c1,c2,a,b,p,q,z,s,x,y;
gotoxy(32,1);
cprintf("Linear Equations");
gotoxy(10,3);
cprintf("( )x + ( )y = ");
gotoxy(11,3);
cscanf("%f",&a);
gotoxy(19,3);
cscanf("%f",&b);
gotoxy(26,3);
cscanf("%f",&z);
gotoxy(50,3);
cprintf("( )x + ( )y = ");
gotoxy(51,3);
cscanf("%f",&p);
gotoxy(59,3);
cscanf("%f",&q);
gotoxy(66,3);
cscanf("%f",&s);
if(a/p==b/q && a/p==z/s)
{
gotoxy(30,5);
cprintf("Co-incident Lines");
gotoxy(30,6);
cprintf("Infinite solution");
}
else if(a/p==b/q && a/p!=z/s)
{
gotoxy(33,5);
cprintf("Parallel Lines");
gotoxy(35,6);
cprintf("No solution");
}
else if(a/p!=b/q)
{
a1=p*a;
b1=p*b;
c1=p*z;
a2=a*p;
b2=a*q;
c2=a*s;
y=(c1-c2)/(b1-b2);
b1=b1*y;
x=(c1-b1)/a1;
gotoxy(35,5);
cprintf("x= %.2f",x);
gotoxy(35,6);
cprintf("y= %.2f",y);
}
getch();
getch();
}
===========================================================================
No comments:
Post a Comment