Comma Operator Trap

Hard
5 views 24 Jan 2026
Write the expression: q = (a = 5, b = 10, a + b);. What is the value of q? Explain the evaluation sequence of the comma operator....

Modulo Magic

Hard
3 views 24 Jan 2026
Test the modulo operator with negative numbers. What result will -7 % 3 give? What difference can there be between different couplings?...

Left Shift Multiplier

Hard
7 views 24 Jan 2026
Left shift the number and multiply it by 2. Neither ...

Bit Counter

Medium
4 views 24 Jan 2026
Count the number of 1 bits in an integer using bitwise operators. Use the & operator in a loop and right shift it....

Short Circuit Proof

Medium
8 views 24 Jan 2026
Write the expression: (a > 0) && (++b > 5). If a = 0, will b be incremented or not? Verify by testing short-circuit evaluation....

Ternary Nesting

Medium
5 views 24 Jan 2026
By assigning grade with nested ternary operators (90+=A, 80+=B, etc). Then write the same logic if-else. Readability compare....

Precedence Puzzle

Easy
3 views 24 Jan 2026
Write the expression: a = 5, b = 10, c = 15; result = a + b * c / 5 - 2 % 3; calculate manually, following operator precedence. Then verify with the program....

Swap Without Temp (XOR)

Easy
3 views 24 Jan 2026
Swap two numbers using the SOR operator. Show step-by-step how the values ​​are exchanged. Provide a mathematical proof...

Power of 2 Checker

Easy
4 views 24 Jan 2026
Check if a number is a power of 2 or not using only bitwise operators. (Hint: n & (n-1) == 0). Explain the logic....

Bitwise Flag Manager

Easy
2 views 24 Jan 2026
8 boolean flags can be stored in a single char variable using bitwise operators. Create Functions: setFlag(), clearFlag(), toggleFlag(), checkFlag()....