Created
November 6, 2017 16:19
-
-
Save IanCarloz/8bd79b0de4a96caaa05cf2cb227b3db8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main(){ | |
/* 2D array declaration*/ | |
int disp[10][2]; | |
/*Counter variables for the loop*/ | |
int i, j; | |
for(i=0; i<10; i++) { | |
for(j=0;j<2;j++) { | |
printf("Enter value for disp[%d][%d]:", i, j); | |
scanf("%d", &disp[i][j]); | |
} | |
} | |
//Displaying array elements | |
printf("Two Dimensional array elements:\n"); | |
for(i=0; i<10; i++) { | |
for(j=0;j<2;j++) { | |
printf("%d ", disp[i][j]); | |
if(j==1){ | |
printf("\n"); | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment