Check if a Integer is power of 8 or not
Submissions: 5034   Accuracy:

25.22%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Sudo Placement 2019

Given a positive integer N, The task is to find if it is a power of eight or not.

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 an integer N.

Output:
In new line print "Yes" if it is a power of 8, else print "No".

Constraints:
1<=T<=100
1<=N<=1018

Example:
Input:

2
64
75
Output:
Yes
No

** 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.