home
Learn
screen_rotation
#include <stdio.h> #include <conio.h> void main(){ int arr[2][3]; int i, j; clrscr(); printf("\n This is 2-d array program."); for(i=0;i<2;i++){ for(j=0;j<3;j++){ printf("\n Enter value for arr[%d][%d] : ",i,j); scanf("%d",&arr[i][j]); } } for(i=0;i<2;i++){ for(j=0;j<3;j++){ printf("\n value of arr[%d][%d] = %d",i,j,arr[i][j]); } } getch(); }
Program Output
This is 2-d array program. Enter value for arr[0][0] : 10 Enter value for arr[0][1] : 11 Enter value for arr[0][2] : 12 Enter value for arr[1][0] : 13 Enter value for arr[1][1] : 14 Enter value for arr[1][2] : 15 value of arr[0][0] = 10 value of arr[0][1] = 11 value of arr[0][2] = 12 value of arr[1][0] = 13 value of arr[1][1] = 14 value of arr[1][2] = 15