1//WAP to print triangle pattern... LOGIC
2int num{}, i{1};
3 cin >> num;
4 while (i <= num) {
5 for (int space = 1; space <= (num - i); space++) { // space
6 cout << " ";
7 }
8 for (int value = 1; value <= (2 * i - 1); value++) { // value
9 cout << value;
10 }
11 cout << endl; //next row
12 i++;
13 }