Description:
- Read a number from user. Let’s say if number is 5, you need to print numbers in triangle pattern as shown below:
If n = 5, then,
1 2 3 4 5
6 _ _ 7
8 _ 9
10 11
12
Note:- Please consider ‘_’ as space. You need to leave space between 2 numbers
Pre-requisites:
- Loops
Inputs:
- Read an Integer ‘n’ from the user
Sample Output:
Test Case 1:
Enter the number: 4
1 2 3 4
5 6
7 8
9
Test Case 2:
Enter the number: 5
1 2 3 4 5
6 7
8 9
10 11
12
310