Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kael89/k-and-r-solutions

Solutions to the problems in The C Programming Language by Brian Kernighan and Dennis Ritchie (K & R)
https://github.com/kael89/k-and-r-solutions

k-and-r

Last synced: about 2 months ago
JSON representation

Solutions to the problems in The C Programming Language by Brian Kernighan and Dennis Ritchie (K & R)

Awesome Lists containing this project

README

        

# k-and-r-solutions

This repository features solutions to the exercises of the book [The C Programming Language](https://www.goodreads.com/book/show/515601.The_C_Programming_Language), by Brian W. Kernighan and Dennis M. Ritchie (**K & R**).

## Running the exercises

```bash
# All exercises
./run

# Exercises in a specific chapter
./run 1

# Specific exercise, eg 1-5
./run 1 5
```

Each exercise features a docblock at its top, featuring:

- The `@description` of the exercise
- For some exercises: an `@interactive` annotation

Interactive exercises will be skipped when running multiple exercises at once (eg all exercises in a chapter). Non-interactive exercises usually feature automated tests that check their correctness, for example:

- Single exercise results

![Single exercise results](./img/single_exercise_results.JPG)

- Multiple exercises result summary

![Multiple exercises result summary](./img/multiple_exercises_result_summary.JPG)

**Hint:** for interactive exercises, press **Ctrl + D** to write `EOF` in the terminal. In K & R exercises, this is used as a signal that user input has finished.

## List of not (yet) implemented exercises

- 1-23
- 1-24
- 2-1
- 4-5
- 4-6
- 4-7
- 4-8
- 4-9
- 4-10
- 4-11