Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Bitwise Operators Questions
Can you perform addition and subtraction using only bitwise operations (e.g., XOR, AND, NOT) without using the + or - operators?
Using bitwise OR (|) with a mask to set multiple bits in an integer: is this a valid and common technique?
Clearing (turning off) one or more bits using bitwise AND in conjunction with bitwise NOT: is the pattern x &= ~mask correct?
Can bitwise OR (|) be used to multiply an integer by powers of 2 (e.g., 2, 4, 8)? Choose the most accurate statement.
Can “bitwise operations alone” reverse the sign of an integer directly (i.e., make x become -x) without any arithmetic step?
In C programming, can bitwise operations be used to generate pseudo-random numbers (for example, in xorshift or linear congruential families)? Provide the most accurate statement.
In C, can the bitwise OR operator (|) be used to set a particular bit of an integer value (for example, set bit k using n | (1 << k))?
1
2