0

hye all :)

can u help me with this code:

int list[4][4] ={7,23,12,6,
	          2,1,4,10,
                 65,15,33,8,
                 18,26,42,12};
int i,j;

for (i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
     cout<<list[i][j];
}
}

there's output but i want it to display 4X4

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by daviddoria
0
for (i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
     cout<<list[i][j] << " "; // put a space between the characters on the same line
}
cout << endl; // start the next line
}
0

thnx,it works,but when i debug,there's four '0' at the bottom ?

0

>> thnx,it works,but when i debug,there's four '0' at the bottom ?

Then it doesn't work. But I don't get the zeroes. I don't see why you would get them either.

0

oh,my bad,thre's something wrong with my coding,tq for the helping :)

0

thelerner - Please mark the thread as solved. It helps so that the next reader does not read through your question only to find that it is no longer a question!

David

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.