Palindrome in both Decimal and Binary
Submissions: 631   Accuracy:

32.37%

  Difficulty: Basic   Marks: 1

Given a number N. check whether a given number N  is palindrome or not in it's both formates (Decimal and Binary ).

Input:

The first line of the input contains T i.e number of test cases. Each line of the test case contains a number  N.

Output:

For each test Case, you have to Print "Yes" or "No" if given number is palindrome   Print "Yes" else "No".

Constraints:

1<=T<=1000

0<=N < 107

Example:

Input:

3
1
12
7

Output:

Yes
No
Yes

Explanation:
Test case 3: 7 is palindrome in it's decimal and also in it's binary (111)  : output is "Yes "

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

Contributor: Nishant singh
Author: Nishant_Singh


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.