#include <stdio.h>
int main (void)
{
int weiners[3][2] = {
{5, 10, 8},
{8, 4, 7},
{3, 1, 2},
{0, 7, 9}
};
int x,y;
printf("Weiners:\n_______\n");
for(x=0;x<=3;++x){
for(y=0;y<=2;++y){
printf("%i, ", weiners[x][y]);
}
printf("\n");
}
return 0;
}
It is simply intended to simply create a small multidimensional array, and then use a loop to print the content. It formats it correctly, and the first three columns are correct, the numbers following them are very wrong. I'm not quite sure what is wrong here.
http://i.stack.imgur.com/TSX2M.png
source
share