ISRO Computer Science (CSE) 2015 - Question 75

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2015

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

  • A. 0101010101
  • B. 0111111111
  • C. 0000000000
  • D. 1111111111

Answer: A. 0101010101

Explanation: Bitwise AND with 1 checks for odd/even.

| | All questions of ISRO Computer Science (CSE) 2015