Hi Vijayan,
Let us go thru your code
Your code works like this
Iter 1 : 1<< 31 = 10000000 00000000 00000000 00000000
i = 5 = 00000000 00000000 00000000 00000101
(1<<31) & 5= 00000000 00000000 00000000 00000000 This exp results line no 8 ie 0
Iter 2 : 1<< 30 = 010000000 00000000 00000000 0000000
i = 5 = 00000000 00000000 00000000 00000101
(1<<30) & 5= 00000000 00000000 00000000 00000000 This exp results line no 8 ie 0
Like this the for loop executes until j becomes 0. Thus the prg is printing the binary value for any given int.
Hope this helps
Indu
[This message has been edited by INDU, BALA (edited August 24, 2001).]