- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
Following C++ program ask to the user to enter row and column size of the array then ask to the user to enter array elements, and the program will display the array elements in two dimensional (i.e., display array elements in row and column):in C++
Source Code: Print Hello World
/* C++ Program - Two Dimensional Array Program */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int arr[10][10], row, col, i, j; cout<<"Enter number of row for Array (max 10) : "; cin>>row; cout<<"Enter number of column for Array (max 10) : "; cin>>col; cout<<"Now Enter "<<row<<"*"<<col<<" Array Elements : "; for(i=0; i<row; i++) { for(j=0; j<col; j++) { cin>>arr[i][j]; } } cout<<"The Array is :\n"; for(i=0; i<row; i++) { for(j=0; j<col; j++) { cout<<arr[i][j]<<" "; } cout<<"\n"; } getch(); }Output
Enter number of row for an Array(max 10):3 Enter number of column for an Array(max 10):3 Now Enter 3*3 Array Elements: 1 2 3 4 5 6 7 8 9 The Array is : 1 2 3 4 5 6 7 8 9