Created
February 8, 2018 14:12
-
-
Save hsandid/b09aa4bfbb6561a29bae691faefaae8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout<<"This Program allows you to solve equations of two unknowns"; | |
cout<<"\n\nPlease Input your coefficients in the following format:\n\nx1\ny1\nz1"; | |
cout<<"\nx2\ny2\nz2\n"; | |
double x,y,x1,x2,y1,y2,z1,z2; | |
cin>>x1; | |
cin>>y1; | |
cin>>z1; | |
cin>>x2; | |
cin>>y2; | |
cin>>z2; | |
x=((-(y2/y1)*z1)+z2)/((-(y2/y1)*x1)+x2); | |
y=((-(x2/x1)*z1)+z2)/((-(x2/x1)*y1)+y2); | |
cout<<"The value of x is "<<x<<endl; | |
cout<<"the value of y is "<<y<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment