Originally Posted by
claudiu
Well you are printing each element on a new line. "\n" in your printf. What you want is probably to print a space between the elements in that inner for printf statement, and then have another printf at the end of each outer for iteration that just prints a new line.
I followed that logic and it did end up working just fine...
but when i tried
Code:
for(i=0;i<10;i++){
printf("%d %d\n", array[i][0],array[i][1]);
}
it ended up printing the pair of numbers before going on to the next pair....not sure why...
However if i had to print just the elements of the first array (array[i]) how would i go about doing that???
I tired adding this to the end of my code:
Code:
for(i=0;i<10;i++){
printf("%d", array[i]);
}
But it did not compile properly...