Change all even bits in a number to 0
Submissions: 1160   Accuracy:

48.17%

  Difficulty: Basic   Marks: 1

Given a number, change all bits at even positions to 0.

Example:

Input : 30
Output : 10
Binary representation of 11110. 
Bits at Even positions are highlighted. 
After making all of them 0, we get 01010

Input:
First line consists of T test cases. Only line, consists of a integer N.

Output:
Single line output, print the modified number.

Constraints:
1<=T<=100
1<=N<=(32-bit number)

Example:
Input:

2
30
10
Output:
10
10

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

Contributor: Saksham Raj Seth
Author: saksham seth


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.