If we wanted to find the value (1 or 0) of the third bit from the right (bitNum = 2) of variable x, we should: int bit =
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
If we wanted to find the value (1 or 0) of the third bit from the right (bitNum = 2) of variable x, we should: int bit =
If we wanted to find the value (1 or 0) of the third bit from the right (bitNum = 2) of variable x, we should: int bit = (x >> 3) & 1; int bit = (x >> 2) & 1; int bit = x & 4; int bit = x >> 3;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!