These25rowsx4columns100dataitemscanbeeasilystoredintwo

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 two­dimensional array The two­dimensional array can be declared for this purpose as: int marks[25][4]; 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 Subscripts Two subscripts are used in two­dimensional arrays the first one is used to denote the rows and the second one is used to denote the columns. e.g. marks[1][0] [1] is...
View Full Document

This document was uploaded on 03/16/2014.

Ask a homework question - tutors are online