user input rep. side lengths of a square

the problem is as such; "Prompt the user for an integer. The value will represent the side lengths of a square. Print out the square using the number 0."

Example 1:
Input:
3

Output:
000
000
000

ive been googleing for hours. what would this be called? what key words could i look up to find a tutorial to teach me?
Hello pnkdlphn,

Sounds like a good problem for a nested for loop. You can start with this
http://www.cplusplus.com/doc/tutorial/control/

Write some code and come back with your problems.

Hope that helps,

Andy
something like this?

1
2
3
4
5
6
7
8
9
10
int input;
cin >> input;

for (int i = 0; i < input; i++)
{
	for (int j = 0; j < input; j++)
		cout << 0;

	cout << endl;
}
Last edited on
stav you're the man! (if you're a man)

could you explain the code to me? im in school and feel like i just cheated because i still dont understand what magic you just conjured
Topic archived. No new replies allowed.