Home Modern Forums ISRO

The for loop

for (i=0; i<10; ++i)printf("%d", i&1);

prints:
(A) 0101010101
(B) 0111111111
(C) 0000000000
(D) 1111111111

Reply To:

The for loop

for (i=0; i<10; ++i)printf("%d", i&1);

prints:
(A) 0101010101
(B) 0111111111
(C) 0000000000
(D) 1111111111

Up
0
Down
::

nan