Problem title
Difficulty
Avg time to solve

Ninja And Editor
Easy
20 mins
Encoded Letter
Moderate
25 mins
Tree Jumping
Hard
50 mins
Base Conversion
Easy
15 mins
Number of ones in the smallest repunit
Moderate
30 mins
Conversion
Easy
20 mins
Remove Comments
Moderate
15 mins
Last Substring In Lexicographical Order
Hard
45 mins
Minimum And Maximum
Easy
15 mins
Rectangles In N x N Board
Moderate
20 mins

Can You Print

Difficulty: EASY
Contributed By
Avg. time to solve
12 min
Success Rate
96%

Problem Statement

You are given an integer ‘N’. You have to print integers from 1 to N.

For Example:
Input: 'N' = 6

Output: 1 2 3 4 5 6

If 'N' = 6, The numbers from 1 to 6 are 1, 2, 3, 4, 5, 6.
Hence, the output will be 1 2 3 4 5 6.
Input Format :
The first line of the input contains an integer, 'T’, denoting the number of test cases.

The first and only line of each test case will contain a single integer ‘N’.
Output Format :
For each test case, print the integers from 1 to N separated by spaces.

Print a separate line for each test case.
Note :
You do not need to print anything, it has already been taken care of. Just implement the given function.
Constraints :
1 <= T <= 10
1 <= N <= 10^4

Time limit: 1 sec
Sample Input 1 :
2
6
2
Sample output 1 :
1 2 3 4 5 6
1 2
Explanation For Sample Output 1 :
For the first test case:
N = 6 
The numbers from 1 to 6 are 1, 2, 3, 4, 5, 6.
Hence, the output will be 1 2 3 4 5 6.

For the second test case:
N = 2 
The numbers from 1 to 2 are 1, 2.
Hence, the output will be 1 2.
Sample Input 2 :
2
3
4
Sample output 2 :
1 2 3
1 2 3 4
Reset Code
Full screen
copy-code
Console