edited by
820 views

2 Answers

Best answer
5 votes
5 votes

In C language an integer constant starting with a 0 is treated as octal. So, $0235 = 157$ in decimal. Now, the code is giving the position of the most significant bit in the binary representation of the number. $157 = (10011101)_2$, so, MSB is at position 8. 

selected by
0 votes
0 votes
8

Binary of 235:11101011

Now doing right shift and incrmenting by 1, means essentially counting the number of bits in the binary version of 235, which is 8.

So ans is 8

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
0 answers
2
0 votes
0 votes
2 answers
3
Khushal Kumar asked Jul 6, 2017
442 views
#include <stdio.h>int main(){printf((5 + "10"));return 0;}
0 votes
0 votes
2 answers
4
Nitesh Choudhary asked Apr 21, 2017
1,327 views
#include<stdio.h>int main(){ int i=10; printf("address of i=%d value of i=%d",&i,i); &i=7200; printf("address of i=%d value of i=%d",&i,i); return 0;...