Jump to content

help for 2D Array

- - - - -

  • Please log in to reply
1 reply to this topic

#1
tanaysaksena

tanaysaksena

    Newbie

  • Members
  • Pip
  • 8 posts
please give me codes for the following question

Write a program to find substraction of matrix of size 5*5(5 rows & 5 coloums)

#2
fayyazlodhi

fayyazlodhi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 403 posts
We can't just paste code.

To help you getting started, you can create two 2D arrays of 5X5 each. Check if the input matrix rows and columns are equal to each other.

Then you run two nested loops.

// pseudo code


while (row from 1 to 5)

    while (column from 1 to 5)

       subtract Matrix2[row][column] from Matrix1[row][column]

    end column while

end row while


Edited by fayyazlodhi, 20 May 2011 - 12:03 PM.
indentation





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users