Given a number N. The task is to generate and print all binary numbers with decimal values from 1 to N.
The first line of input contains an integer T denoting the number of test cases. There will be a single line for each testcase which contains N.
Print all binary numbers with decimal values from 1 to N in a single line.
1 ≤ T ≤ 106
1 ≤ N ≤ 106
1 10 11 100 101
Testcase 1: Binary numbers from 1 to 2 are 1 and 10.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.