This preview shows page 1. Sign up to view the full content.
Unformatted text preview: nd columns)
And every element is accessed by two subscript numbers.
For example If we want to process the marks of 25 students in four tests then this data can be arranged in a table as
Student No Test Number
1 2 3 4 1 79 99 66 33 2 88 33 44 55 3 55 22 55 44 ..
.. 25 56 62 74 91 In this table the marks of student no 1 in four test are in 1st row and marks of student In this table the marks of student no 1 in four test are in 1st row and marks of student no 2 are in second row and so on.
These 25rows x 4columns=100 data items can be easily stored in twodimensional array
The twodimensional array can be declared for this purpose as:
It reserves hundred locations in computer memory for storing hundred integer values. It will look like in memory as: To access one location two subscript numbers are used Subscripts
Two subscripts are used in twodimensional arrays the first one is used to denote the rows and the second one is used to denote the columns.
View Full Document
This document was uploaded on 03/16/2014.
- Spring '14