Binary representation of next number
Submissions: 1231   Accuracy:

13.48%

  Difficulty: Basic   Marks: 1

Given a binary input that represents binary representation of whole number n, the task is to find binary representation of n+1.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a binary representation of whole number.

Output:
For each test case, print the binary representation of number n+1.

Constraints:
1<=T<=500
1<=|Number.size|<=103

Example:
Input:

2
10
110
Output:
11
111

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Arun Tyagi
Author: arun03


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.