i am struggling with producing the right output through this code which should take any normal matrix and convert it into an upper triangular matrix.
here is my current code:
it has to do row operations to create a matrix with zeros under the main diagonal but it seems my code only changes one particular element within the row. for example the first loop is supposed to take the first element in the matrix and divide the whole first row in order to make it one but it does not carry out the whole row operation. the other elements remain unchanged
And to add to what programmer first said. Also edit your original post and put everything between code tags like you did in your second post @muthavhatsindi.
oh sorry for that, but yeah its basically Gaussian elimination so from the first row it should take the element 3 and divide the whole row by three to change the first element in the firs row to 1 and the other elements to the appropriate outputs after dividing. after getting a one then we use the first row to change the other rows by multiplying the number which is the first element in each row to row one then subtracting row one to that particular row being the 2nd and third successively. after that operation we should be having the first column having one at the top and zeros bellow it. i hope that clears it up a bit more.
oh i found my problem. the loop was taking the reference number from my array after it had changed so that is why the rest of my elements in the row were not changing. i had to declare a variable that held the reference numbers constant until the end of the loop. thanx for the help.