hi there. having some problems reading in a 2d array by column, then row. i'm programming simple dos-type "console application" programs. i'm not sure how to input the data eg. how many spaces between each array element, and the code i've got below doesn't generate the required output.
here's what i got so far: (any ideas appreciated)
Code:
#include <stdio.h>
#include <conio.h>
#include <string.h>
main()
{
int i, j, bus[4][5];
for(j = 0; j <= 5; j = j + 1)
}
for(i = 0; i <=4; i = i + 1)
scanf(" %d", &bus[i][j]);
{
for(j = 0; j <= 5; j = j + 1)
printf("Give the number of passengers for day 1: bus[i][0]");
printf("Give the number of passengers for day 2: bus[i][1]");
printf("Give the number of passengers for day 3: bus[i][2]");
printf("Give the number of passengers for day 4: bus[i][3]");
printf("Give the number of passengers for day 5: bus[i][4]");
getch();
}
2d array by column, then row