Another Beginner problem...

Hi all again, I searched but did not find a thread that helped.

Why o why is my pattern going vertically, I need it to go horizontal. I'm assuming I need a const for width but that's as far as I can get.

Please excuse the questions that will be undoubtedly coming from me in the future as well. I'm working 6 days a week and my brain is fried by the time I get to coding.

Thanks as always!!

edit: cin @ bottom is to see prog run.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 #include "stdafx.h"
#include <iostream>


using namespace std;

int main()
{
    int col, row, num2;

		for (row = 1; row <= 10; row++)
		{
			
		for (col = 1; col <= row; col++)
		
			cout <<  "*" << '\n';
		
		    cout << '\n';
		}
		
		cin >> num2;
		return 0;
}
Last edited on
Why o why is my pattern going vertically
Because of the '\n' on line 16. Remove it and it will go horizontally
Thanks!
Topic archived. No new replies allowed.