Vyom World.com Let's Touch the Sky Together!
 Home VyomWorld.com Home Free Magazines! VyomLinks.com Home JobsAssist.com Home Vyom Network Contact Us Jobs & Careers Resume Submitter Placement Papers IT Companies Directory Computer Jobs Interview Questions Online Exams Vyom Career eMag. Fun Screensavers New! Send FREE SMS! SMS Jokes Source Codes Library Source Codes Home ASP Source Codes C Source Codes C++ Source Codes COBOL Source Codes Java Source Codes Pascal Source Codes Submit Source Codes GATE GATE an Overview GATE Preparation Study Materal GRE GRE an Overview GRE Questions GRE Preparation GRE Universities TOEFL Preparation TOEFL Resources GMAT Preparation GMAT Resources MBA Preparation MBA Resources Networking Concepts Networking Concepts Testing Preparation Testing Resources Webmasters Free Traffic Builder Webmaster Articles Web Hosting Tutorials Hardware Tutorial 1500 Free eBooks New! FREE Publications
Vyom Career eMag.
 Get 9,000+ Interview Questions & Answers in an eBook. 9,000+ Interview Questions All Questions Answered 5 FREE Bonuses Free Upgrades Get it now!
Get 9,000+ Interview Questions with Answers in an eBook

Home >> Source Codes Library Home >> Language Home >> Category Home > > Item Description
Search Code Library

 Title Program to solve a 3 Variable Linear Equation. Author: Adarsh Ramamurthy Visitor Submitted Source Code Author Email: adarsh83@rediffmail.com Description: Solves any 3 variable linear equation. Hits: 5940 Since 25th November, 2003 Code: Select and Copy the Code #include #include #include main() { clrscr(); float a,b,c,d,l,m,n,k,p,D,q,r,s,x,y,z; printf("PROGRAM TO SOLVE THREE VARIABLE LINEAR SIMULTANEOUS EQUATIONS\n\n"); printf("The equations are of the form:\n\nax+by+cz+d=0\nlx+my+nz+k=0\npx+qy+rz+s=0\n\n"); printf("Enter the coefficients in the order a,b,c,d,l,m,n,k,p,q,r,s\n"); scanf("%f%f%f%f%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&l,&m,&n,&k,&p,&q,&r,&s); printf("\nThe equations you have input are:\n\n"); printf(" %.2f*x + %.2f*y + %.2f*z + %.2f = 0\n",a,b,c,d); printf(" %.2f*x + %.2f*y + %.2f*z + %.2f = 0\n",l,m,n,k); printf(" %.2f*x + %.2f*y + %.2f*z + %.2f = 0\n\n",p,q,r,s); D = (a*m*r+b*p*n+c*l*q)-(a*n*q+b*l*r+c*m*p); x = ((b*r*k+c*m*s+d*n*q)-(b*n*s+c*q*k+d*m*r))/D; y = ((a*n*s+c*p*k+d*l*r)-(a*r*k+c*l*s+d*n*p))/D; z = ((a*q*k+b*l*s+d*m*p)-(a*m*s+b*p*k+d*l*q))/D; printf("The solutions to the above three equations are :\n\n"); printf(" x = %5.2f\n y = %5.2f\n z = %5.2f\n",x,y,z); getch(); return 0; }

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home