index
| submit
| rank
| book

## bits2bytes – Bits to bytes

Write a program that converts a quantity in bits to a quantity in bytes.

### Input and Output

The input contains several lines each with one integer
*n* where 0 ≤ *n* < 65 536.

Each line of output should contain a corresponding integer *m*
indicating how many bytes are needed to store *n* bits.

#### Example input

```
64
16
2880
8190
```

#### Example output

```
8
2
360
1024
```

### Scoring

- 1/6: works for the above example but produces output in an incorrect format
- 2/6: works for the above example and produces output in the correct format
- 4/6: works for other test cases
- 6/6: works for edge cases

### Hints

How many bytes are needed to store 1 bit?
How many bytes are needed to store 9 bits?

try first: bin2dec dec2bin

try also: bytes2bits

try next: kilobytes

index
| submit
| rank
| book

Copyright © 2020-2021 Rudy Matela

All rights reserved