int main() { int a 1; int b 10; a = 0 | b; Ob printf("%d%d", a, a, b); а if (a | b ) printf("INSIDE IF"); else printf ("INSIDE ELSE"); return 0; }
Answers
Answered by
0
Answer:
1010INSIDE IF
Explanation:
| is bitwise OR operator in C.
For example
12 = 00001100 in Binary.
25 = 00011001 in Binary.
Bitwise OR operation of 12 and 25
00001100
00011001
---------------
00011101 =. 29 in decimal.
int a = 0 | b ;
here b = 10, bitwise OR with 0 results in same number.
Then a = 10;
if ( a | b ) results in 10 which is true. Therefore, it prints the if block statement.
Similar questions