I have no clue why my code won't compile....I am trying to use 2d arrays to read in 20 numbers in pairs and have them print out each pair in a new line....
I know that a nestled loop is needed but i am not totally sure that i am doing this properly...Code:#include <stdio.h> int main (int argc, char *argv[]) { int array[10][2]; int i=0; int j=0; printf("Enter 10 integers: \n"); for(i=0; i<10; i++) { scanf("%d", &array[i]); for(j=0;j<2;j++) { scanf("%d", &array[j]); } } for(i=0;i<10;i++) { printf("%d", array[i]); for(j=0;j<2;j++) { printf("%d\n", array[j]); } } return 0; }
Any help is appreciated...



LinkBack URL
About LinkBacks




