Outline for April 3, 2002

Handouts: Sample Basic C Programs
Reading: Johnsonbaugh & Kalin pp. 31-63


  1. Greetings and felicitations!
  2. fahr1.c
    1. program (main, return or exit for main)
    2. declarations (int, register int)
    3. body (while, functions; printf)
  3. Basic operators
    1. arithmetic: +, -, *, /, %
    2. % defined so that n % p = r implies n = a * p + r for some a
    3. 5 % -2 can be 1 (5 = -2 * 3 + 1) or -1 (5 = -2 * 2 + -1)
  4. fahr2.c
    1. macros
    2. include <stdio.h>


ECS 30-A, Introduction to Programming
Winter Quarter 2002
Email: [email protected]