Hello I was on here last night wish an issue with my code and I got a for loop that helped me fix my problem. now I need to change that loop to display on the screen:
4###
44##
444#
4444
This for loop completes the first line but I am having trouble getting it to display the consecutive 4 for the last 3 lines.
The code I have is
1 2 3 4 5 6 7 8 9 10
for (int r = 0; r < size; r++)
{
cout << endl;
for (int c = 0; c < size; c++)
if (r == c)
cout << size;
else
cout << '#';
}
Size is an int variable and this code displays on the screen
Please try and format your code into source code so that way it is easier to read. When you start a new topic, the code and /code in brackets should already be there, just get your code between them, don't delete it, and it will format it correctly.