Lol actually, Adak, it worked! I Had to tweak it a bit. But now I found another bug, prolly the last one! The code below is the mathematical algorithm the matrix does... The only problem is with division - if I enter numbers to divide - any numbers - it will tell me it failed (failed = the sum is NOT an integer!)
Code:
switch (matrix[i][j])
{
case '+': matrix[i+1][j] = (matrix[i-1][j]) + (matrix[i+1][j]);
break;
case '-': matrix[i+1][j] = (matrix[i-1][j]) - (matrix[i+1][j]);
break;
case '*': matrix[i+1][j] = (matrix[i-1][j]) * (matrix[i+1][j]);
break;
case '/': if ((matrix[i+1][j]) ==0 )
{
printf("There is a division by zero");
return 1;
}
if (((matrix[i-1][j] / matrix[i+1][j])%2) != 0)
{
left=1;
}
if (left == 1 )
{
printf("There is a non-integer division");
return 1;
}
matrix[i+1][j] = (matrix[i-1][j]) / (matrix[i+1][j]);
break;
}
I tried a few variations but none worked...
The %2 thingy doesn't work for some reason.... and it enters the "Non Integer division" all the time! Even if : 1/1-1
Suggestions?