Chapter 1: A Tutorial Introduction

Chapter one introduces the reader to the C programming language by using simple example code, and by presenting several “Exercises” that present real-world application.

Here is a listing of the code I have written through Chapter 1. I hope that you’ll notice that my coding practices improved. I’ve noticed it.

Exercise 1-1. Run the “hello, world” program on your system. Experiment with leaving out parts of the program, to see what error messages you get. Pg. 8.

Exercise 1-2. Experiment to find out what happens when printf’s argument string contains \c, where c is some character not listed above. (Note - the “above listed” escaped characters at this point in the book have been \n, and that’s it.) Pg. 8.

Exercise 1-3. Modify the temperature conversion program to print a heading above the table. Pg. 13.

Exercise 1-4. Write a program to print the corresponding Celsius to Fahrenheit table. Pg. 13.

Exercise 1-5. Modify the temperature conversion program to print the table in reverse order, that is, from 300 degrees to 0. Pg. 14.

Exercise 1-6. Verify that the expression getchar() != EOF is 0 or 1. Pg. 17.

Exercise 1-7. Write a program to print the value of EOF. Pg. 17.