Welcome to my repository of solutions for the exercises from "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie. This book is a classic and fundamental resource for learning the C programming language.
This repository contains my personal solutions to the exercises from the second edition of "The C Programming Language" by K&R. Each solution is implemented in C and organized by chapter.subchapter number.
Each chapter directory contains the corresponding exercise solutions in separate .c files.
To compile and run the solutions, you need a C compiler such as gcc. Below are the steps to compile and run a specific exercise:
-
Navigate to the directory containing the exercise:
cd ch1.10 -
Compile the exercise using
gcc:gcc -o ex1.20 ex1.20.c
-
Run the compiled program:
./ex1.20
Feel free to modify and experiment with the code to better understand the concepts.
This repository covers exercises from all chapters of the book:
- Chapter 1: A Tutorial Introduction
- Chapter 2: Types, Operators, and Expressions
- Chapter 3: Control Flow
- Chapter 4: Functions and Program Structure
- Chapter 5: Pointers and Arrays
- Chapter 6: Structures
- Chapter 7: Input and Output
- Chapter 8: The UNIX System Interface
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Contributions are welcome!
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push your branch and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Happy coding and learning!