Outline for April 4, 2023
Reading: zyBooks §1, 2.1–2.8, 2.11–2.14, 2.16, 2.18, 2.20; Handouts: 3, 4
Due: Homework #1, due April 15, 2024
- Example program 2: fahr1.c
- Program (main, return or exit for main)
- Declarations (int, register int)
- Body (while, printf)
- Variable names
- Basic types
- int, long vs. short, unsigned vs. signed
- char, treated like an int that holds 1 character
- float, double
- Type casting
- Basic operators
- arithmetic: +, −, *, /, %
- % defined so that n % p = r implies n = ap + r for some a
- 5 % −2 can be 1 (5 = (−2) × (−2) + 1) or −1 (5 = (−3) × (−2) + (−1))
- Associativity of operations
- Difference between associativity of operations and order of evaluation
Papers
- Processes and the Shell, processes.pdf
- Compiling and Executing Your Program, compiling.pdf