0 votes 0 votes what does putchar(x&m) does in the question? Programming in C usergate2019 usermod programming-in-c + – balchandar reddy san asked Jan 5, 2019 edited Jan 5, 2019 by balchandar reddy san balchandar reddy san 428 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply vg653 commented Jan 5, 2019 reply Follow Share Answer is A ?? 0 votes 0 votes kumar.dilip commented Jan 5, 2019 reply Follow Share I think option A is correct. 0 votes 0 votes balchandar reddy san commented Jan 5, 2019 reply Follow Share yes..how? 0 votes 0 votes kumar.dilip commented Jan 5, 2019 reply Follow Share n = n & (n-1) // will give 136. Let's come to the inside the Display function. Here loop is running from the 31 to 0. For the first time i = 31. then m = 2^31. Perform bitwise & between ( 136 & 2^31) if it is not equal to zero then print 1 otherwise 0. here will be zero So, it will print 0. Same result 0 will be printed from 31 to 8. Here 136 = 1000 1000 Then for the loop i = 7. m = 2^7 = 128. ( 136 & 128) here result will be 0. you can further proceed. The answer will be. 00000000 00000000 00000000 10001000 1 votes 1 votes vg653 commented Jan 5, 2019 reply Follow Share Let me explain you!! In main if we apply bitwise & between n and n-1 we will get the value of n as 136 i.e. 10001000. And new value of n is being passed to display. In display: m=1<<i ------ this statement is left shift of 1 by i bits, so for i = 31 , m= 10000000000000000000000000000000 for i = 20 m=1000000000000000000000000000000 ... ... and the statement is getting repeated 32 times and each time x&m is to calculated. and by ternary operator either we get 1 or 0... That's how the answer is A.. Hope this helps!! 1 votes 1 votes Please log in or register to add a comment.