0

What is the output? (Explain)

/* Can someone give me a better solution and explain me how to get the output for this source code? */ #include <stdio.h> int main(void) { int i = 1, j = 0, k; k = (i >> j) + (j >> i) + (i >> i) + (j >> j); k <<= i; printf("%d", k); return 0; }

6th Apr 2020, 8:10 AM
Isuru Harischandra
Isuru Harischandra - avatar
1 Answer
0
the bitwise(L to R) (>>) operator requires two operands. the bits in the first operand are shifted to the right by the number of positions specified in the second operand. for example, 12 >> 2 shifts the bits representing 12 (1100) two places to the right to result in (0011) and the with (R to L)......😄
6th Apr 2020, 9:37 PM
Amine Laaboudi
Amine Laaboudi - avatar