in Programming in C
560 views
3 votes
3 votes

Consider the following program along with push and pop operations on stack which can contain atmost 

The decimal value equivalent to the binary number printed by above code is _______

in Programming in C
560 views

8 Comments

ans is  57 please give me solution
0
0
If num is even then the output will be 0 and if num is odd then 1 will be printed 8 times ..
How can 57 come?
57 has binary  representation as 111001. Each bit is the value of num at some iteration. But whenever num=0 the loop breaks! :o
0
0

 @Manu Thakur Sir can you please help 

1
1
what is the input to this program? if you run this program for num=4 program pushes 2 to stack, print 0 and exits.
2
2
Yes and for odd number I guess it prints 11111111 i.e. 255 .
0
0
this is made easy Q exactly  same ( i just copy and paste )

i m not getting answer  

i need your help in this q
0
0
what is the input
0
0
how they have given answer 57, no input is given for the question.
0
0

Please log in or register to answer this question.