C | Loops & Control Structure | Question 5
Predict the output of the below program:
Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C
course to start learning today.
#define EVEN 0
#define ODD 1
i = 3;
(i & 1)
(D) Compile-time error
Explanation: The expression i & 1 returns 1 if the rightmost bit is set and returns 0 if the rightmost bit is not set. As all odd integers have their rightmost bit set, the control goes to the block labeled ODD.