Skip to Main Content
Fundamentals of Computer Programming and IT by Pearson
book

Fundamentals of Computer Programming and IT by Pearson

by Ashok Namdev Kamthane, Rohit Khurana
May 2024
Intermediate to advanced content levelIntermediate to advanced
577 pages
22h 34m
English
Pearson India
Content preview from Fundamentals of Computer Programming and IT by Pearson
Arrays 359
if(i<=2 && j==1)
disp(&a[i][j]);
}
cout<<” “;
}
getch();
}
int disp(int *y)
{
cout<<” “<<*y;
}
Output:
Entered Elements are:
1 2 3
4 5 6
7 8 9
13.7 MULTIDIMENSIONAL ARRAYS
The C++ language permits declaration and initialization of multidimensional arrays. The syntax of a multidi-
mensional array is as follows:
arrayname[S1][S2][S3]...[Sn]
where Si is the size of the i
th
dimensions
Example: A three-dimensional array can be initialized as follows:
int mat[3][3][3] =
{
1,2,3,
4,5,6,
7,8,9,
1,4,7,
2,5,8,
3,6,9,
1,4,4,
2,4,7,
8,8,5
};
The program given in Example 13.5 supports multidimensional arrays.
Write a program to display the elements of a multidimensional ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Basic Computer Engineering (Subject Code: BE - 205)  by Pearson

Basic Computer Engineering (Subject Code: BE - 205) by Pearson

Anita Goel, Anand Motwani

Publisher Resources

ISBN: 9781299447479