Some code presented here is based on the solutions of Henrik Samuelsson.
- Chapter 3: Compiling and running your first program
- Chapter 4: Variables, data types and arithmetic expressions
- Chapter 5: Program looping
- Chapter 6: Making decision
- Chapter 7: Working with arrays
- Chapter 8: Working with functions
- Chapter 9: Working with structures
- Chapter 10: Character strings
- Chapter 11: Pointers
- Chapter 12: Operations on bits
- Chapter 13: The preprocessor
- Chapter 14: More on data types
- Chapter 16: Input and output operations in C
- Exercise 1: source code from the chapter
- Exercise 2: displaying multiple lines of output
- Exercise 3: output without line breaks
- Exercise 4: displaying the result of an expression in one step
- Exercise 5: displaying the result of an expression in two steps
- Exercise 6: initializing integer variables
- Exercise 1: source code from the chapter
- Exercise 4: fahrenheit - celsius conversion
- Exercise 5: initializing character variables
- Exercise 6: evaluation of polynomial
- Exercise 7: evaluation of expression with exponentials
- Exercise 8: next largest even multiple
- Exercise 1: source code from the chapter
- Exercise 2: table of squares
- Exercise 3: triangular numbers for every 5th number between 5 and 50
- Exercise 4: first ten factorials
- Exercise 5: restructured code
- Exercise 6: table of triangular numbers, 05-03 modified
- Exercise 7: formating output
- Exercise 8: amount of triangular numbers by user input, 05-05 modified
- Exercise 9: modified source code from the chapter with while loops
- Exercise 11: sum of digits
- Exercise 1: source code from the chapter
- 6.1 - absolute value of an integer
- 6.2 - average of grades, number of failing grades
- 6.3 - determine parity
- 6.4 - determine parity with if-else
- 6.5 - determine leap year
- 6.6 - signum function
- 6.7 - categorize a single character
- 6.8 - evaluate simple expression: number - operator - number
- 6.8A - evaluate simple expression, 06-08 modified
- 6.9 - evaluate simple expression with switch-case, 06-08A modified
- 6.10 - table of prime numbers
- 6.10A - table of prime numbers with stdbool, 06-10 modified
- Exercise 2: check if two numbers are are evenly divisible
- Exercise 3: division of two integers
- Exercise 4: simple calculator
- Exercise 5: reversing digits of a number, 05-09 modified
- Exercise 6: displaying number with english words
- Exercise 7: table of prime numbers, 06-10A modified
- Exercise 1: source code from the chapter
- Exercise 2: initializing array, 07-01 modified
- Exercise 3: counter array, 07-02 modified
- Exercise 4: averaging floats
- Exercise 5: geometric sequence
- Exercise 6: first 15 Fibonacci numbers without arrays, 07-03 modified
- Exercise 7: the Sieve of Eratosthenes
- Exercise 1: source code from the chapter
- 8.1 - defining a function
- 8.2 - calling a function, 08-01 modified
- 8.3 - calling a function multiple times, 08-01 modified
- 8.4 - n. triangular number function
- 8.5 - greatest common divisor function
- 8.6 - greatest common divisor function, 08-05 modified
- 8.7 - absolute value function
- 8.8 - square root function (Newton–Raphson method)
- 8.9 - minimum function
- 8.10 - minimum function with variable length array, 08-09 modified
- 8.11 - modifing array elements from functions
- 8.12 - sorting function
- 8.13 - multidimensional array as function parameter
- 8.13A - multidimensional array with variable length as function parameter, 08-13 modified
- 8.14 - conversion of positive integer of base ten to another base, 07-07 modified
- 8.15 - static and automatic variables
- 8.16 - factorial function (recursive)
- Exercise 2A: n. triangular number function, 08-04 modified
- Exercise 2B: n. triangular number function, 05-05 modified
- Exercise 3: square root function (Newton–Raphson method), 08-08 modified
- Exercise 4: square root function (Newton–Raphson method), 08-e03 modified
- Exercise 5: square root function (Newton–Raphson method), 08-e04 modified
- Exercise 6: square root function (Newton–Raphson method), 08-e05 modified
- Exercise 7: power function
- Exercise 8: find the real roots of a quadratic equation
- Exercise 9: least common multiple function
- Exercise 10: determine if a number is a prime
- Exercise 11: sum function
- Exercise 12A: transpose matrix function
- Exercise 12B: transpose variable size matrix function, 08-e12A modified
- Exercise 13: sorting function, 08-12 modified
- Exercise 14: modified source code of the exercises with global variables
- Exercise 15: conversion of positive integer of base ten to another base, 08-14 modified
- Exercise 16: conversion of positive integer of base ten to another base, 08-e15 modified
- Exercise 1: source code from the chapter
- Exercise 2: number of days between two dates
- Exercise 3: elapsed time
- Exercise 4: determine what day is a certain date
- Exercise 5: update time and date
- Exercise 6: tomorrow's date, 09-04 modified
- Exercise 1: source code from the chapter
- 10.1 - concatenate two strings
- 10.2 - determine the length of a string
- 10.3 - concatenate two strings, 10-01 modified
- 10.4 - equality of two strings
- 10.5 - reading a string with scanf
- 10.6 - reading a line of text
- 10.7 - count the number of words in a line
- 10.8 - count the number of words in a text
- 10.9 - find word in a dictionary
- 10.10 - find word in a dictionary, 10-09 modified
- 10.11 - convert string to numerical value
- Exercise 3: count the number of words in a line, 10-07 modified
- Exercise 4: extract substring function
- Exercise 5: find substring function
- Exercise 6: remove substring function
- Exercise 7: insert substring function
- Exercise 8 & 9: replace string function
- Exercise 10: sort dictionary function
- Exercise 11: convert string to integer, 10-11 modified
- Exercise 12: convert string to float
- Exercise 13: uppercase function
- Exercise 14: convert integer to string
- Exercise 1: source code from the chapter
- 11.1 - declaring pointers
- 11.2 - pointers basics
- 11.3 - pointers in expressions
- 11.4 - pointers referencing structures
- 11.5 - structures containing pointers
- 11.6 - linked lists
- 11.7 - traversing linked lists
- 11.8 - pointers and functions
- 11.9 - changing values from functions with pointers
- 11.10 - returning a pointer from a function
- 11.11 - pointers referencing arrays
- 11.12 - arraySum function with pointers, 11-11 modified
- 11.13 - pointers referencing strings
- 11.14 - copyString function with pointers, 11-13 modified
- 11.15 - stringLength function with pointers
- Exercise 2: insertEntry function
- Exercise 3: insertEntry function, 11-e02 modified
- Exercise 4: removeEntry function
- Exercise 5: doubly linked lists
- Exercise 6: functions for doubly linked lists
- Exercise 7: sorting function, 08-e13 modified
- Exercise 8: sort3 function
- Exercise 9: readLine function, 10-06 modified
- Exercise 10: compareStrings function, 10-10 modified
- Exercise 11: dateUpdate function, 09-e06 modified
- Exercise 12: various printf parameters
- Exercise 1: source code from the chapter
- Exercise 3: MIN macro
- Exercise 4: MAX3 macro
- Exercise 5: SHIFT macro, 12-03 modified
- Exercise 6: IS_UPPER_CASE macro
- Exercise 7: IS_ALPHABETIC macro
- Exercise 8: IS_DIGIT and IS_SPECIAL macros
- Exercise 9: ABSOLUTE_VALUE macro
- Exercise 10: PRINTX macro
- Exercise 11: isupper, isalpha, isdigit functions of the standard library
- 14.1 - the enumerated type
- Exercise 1: defining a function pointer type
- Exercise 2: monthName function
- Exercise 3: type conversions