This repository contains solutions to the programming assignments from the book "C Programming Language, 2nd Edition" by Brian W. Kernighan and Dennis M. Ritchie. The solutions are organized by chapters and exercises.
"The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie is a definitive reference guide and a popular book for learning C programming. Originally written in 1978, it continues to be a worldwide bestseller. The second edition, which includes updates for the ANSI standard, brings the classic original up to date.
For more information, please refer to the book "The C Programming Language, 2nd Edition" by Brian W. Kernighan and Dennis M. Ritchie.
The repository is organized into directories, each corresponding to a set of exercises:
.
├── exercise_1
│ ├── question_1.c
│ ├── question_2.c
│ ├── question_3.c
│ └── ...
├── exercise_2
│ ├── question_1.c
│ ├── question_2.c
│ ├── question_3.c
│ └── ...
├── ...
└── exercise_8
├── question_1.c
├── question_2.c
├── question_3.c
└── ...
Each directory contains .c files that represent solutions to specific exercises from the book.
-
Clone the Repository:
git clone https://github.com/lavish440/c-practice cd c-practice -
Navigate to the Desired Exercise Directory:
cd exercise_1 -
Compile the C Programs: You can compile any of the C files using a C compiler like
gcc:gcc question_1.c -o question_1
-
Run the Executable:
./question_1
- A C compiler (e.g.,
gcc) - Make sure to have a proper C development environment set up on your machine.
Contributions are welcome! If you have improved solutions or additional exercises, feel free to fork the repository and create a pull request.
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes
- Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
