These are some of the exercises from different sections of the first chapter - CHAPTER 1: A Tutorial Introduction of the book C Programming Language (second edition) by Brian W. Kernighan and Dennis M. Ritchie.
The following are just eight of the exercises and solutions covering various topics of the introductory C programming.
Run the "Hello, world" program on your system. Experiment with leaving out parts of the program to see what error messages you get.
Solution: ex_1_1.c
1-3 Modify the temperature conversion program to print a heading above the table.
Solution: ex_1_3.c
Modify the temperature conversion program to print the table in reverse order, fom 300 degrees to 0.
Solution: ex_1_5.c
Write a program to count blanks, tabs and newlines.
Solution: ex_1_8.c
Write a program to print a histogram of the lenghts of the words in its input. It is easy to draw a histogram with the bars horizontal; a vertical orientation is challenging.
Solution: ex_1_13.c
Rewrite the temperature conversion program of Section 1.2 to use a function for conversion.
Solution: ex_1_15.c
Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input a line at a time.
Solution: ex_1_19.c
Write a program to remove all comments from a C program. Don't forget to handle quoted strings and character constants properly. C comments do not nest.