> For the complete documentation index, see [llms.txt](https://valineliu.gitbook.io/deuterium-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valineliu.gitbook.io/deuterium-wiki/reading/cs-jing-dian-shu-ji/csapp-3e-homework-solution/2.-representing-and-manipulating-information/2.61-more-bit-expressions.md).

# 2.61 More Bit Expressions

★★

**Problem**:

Write C expressions that evaluate to 1 whenb the following conditions are true and to 0 when they are false. Assume `x` is of type `int`.

A. Any bit of `x` equals 1:

```c
!~x
```

B. Any bit of `x` equals 0:

```c
!x
```

C. Any bit in the least significant byte of `x` equals 1:

```c
!~(x & 0xff)
```

D. Any bit in the most significant byte of `x` equals 0:

```c
!((x >> ((sizeof(int) - 1) << 3)) & 0xff)
```

###
