0

Ok, I'm really having a hard time with this, but I don't even know what I'm missing. I t should be easy.
Here's the problem:
You have a linear equation system: a1x+a2y=a3 // a4x + a5y=a6. Ask for a1, a2, a3, a4, a5 and a6 as input, solve x and y and print them as output.

Now, the problem is that whenever I try to use any of the methods I know to solve a linear equation system, It just seems to odd to actually put it in the code. Example:

solveY() {
// reduction method.
// -a4*(a1x+a2y=a3)
//  a1*(a4x+a5y=a6)
// x gets deleted, so after adding you get: a1*a5*y-a4*a2*y=a3+a6
// How the hell do I clear y from that? 
}

solveX() {
// some substitution code.
}


int main() {

float a1, a2, a3, a4, a5, a6;
printf("What's the value for a1?");
scanf("%f" &a1)
.
.
.
printf("What's the value for a6?");
scanf("%f" &a6)

solveY();
solveX();

return;
}

Edited by patricioparga: typo.

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by I_m_rude
0

try to find it on google.com. it is available and you will get it very easily overthere. here goes www.google.com.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.