How to display numbers by line depending on the number in C++?
<p>Hi I am new to C++ and I am having problem with displaying the numbers from 1,2,3, and so on depending on the user input.</p>

<p>For example, if input is 3, first line of output should be 1, next line should be 2 3, and the last line should be 4 5 6. Please see below screenshot:</p>

<p><a href="https://i.stack.imgur.com/rXn2L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rXn2L.png" alt="enter image description here"></a></p>