Mrs. S- JAVA Bits Set 1
Submissions: 277   Accuracy:

71.16%

  Difficulty: Basic   Marks: 1

Mrs. S is very intelligent and very curious to learn new things. She was learning few Bit-algorithms but stuck somewhere and wants your help. The task is to count the set-bits and non set-bits of an integer N. Help her doing the same.

Input:
First line consists of T testcases. Only line of every testcase consists of an integer N.

Output:
For each testcase in new line, print the count of set-bits and non set-bits separated by space.

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

Example:
Input:

2
8
7

Output:
1 3
3 0

Explanation:
Testcase 1:
Binary representation of the given number 8 is: 1 0 0 0. In this representation number of set-bits and non set-bits is 1 and 3.

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