Friday, 22 November 2019

UGC NET PAPER 2 June 2019 Question 24 (Shift-I)

24. Consider the following C++ function f() :
unsigned int f(unsigned int n)
{
unsigned int b=0;
while(n)
{
b+=n&1;
n>>=1;
}
return b;
}
The function f() returns the int that represents the___p___in the binary representation of positive integer n, where P is
A number of 0's
B number of bits
C number of consecutive 1's
D number of 1's
ANS. D

PreviousNext
UGC NET CS 2018 July - II Question 23UGC NET CS 2018 July - II Question 25

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts