This section portrays the answers to the exercises found in the C Book, a textbook found online to refresh my abilities with the C programming language. This page links to the answers of exercises found in chapter one.
Type in and test Example 1.1 on your system.
Using Example 1.2 as a pattern, write a program that prints prime pairs, a pair of prime numbers that differ by 2, for example 11 and 13, 29 and 31.
Write a function that returns an integer: the decimal value of a string of digits that it reads using getchar. For example, if it reads 1 followed by 4 followed by 6, it will return the number 146.
Use the function that you just wrote to read a sequence of numbers. Put them into an array declared in main, by repeatedly calling the function. Sort them into ascending numerical order, then print the sorted list.
Again using the function from Exercise 1.3, write a program that will read numbers from its input, then print them out in binary, decimal and hexadecimal form.