Slight help please
Write a program to display the below pattern with rows, where is in the range between 1 and 100. The variable should be entered by the user. If the user input is between 1 and 100 then output the pyramid as given below, otherwise prompt the user to enter again. Here is the sample output: Enter the number of rows: 6 1 2 3 3 4 5 4 5 6 7 5 6 7 8 9 6 7 8 9 10 11 ........... What to do to make it in a correct form My code is #include <iostream> using namespace std; int main(){ int n; int num=1; cout << " Enter the number of rows:"; cin >> n; for( int row =1 ; row <= n; row++){ int x=row; for (int num= 1 ; num <= row ; ++num ){ cout << num <<" " ; ++x; } cout << endl; } return 0;} My output is 1 1 2 1 2 3 N so on