Outline for April 2, 2025

Reading: zyBook §1, 2.20; handouts 3, 4
Due: Homework #1, due April 14, 2024


  1. Example program 2: fahr1.c
    1. Program (main, return or exit for main)
    2. Declarations (int, register int)
    3. Body (while, printf)

  2. Variable names
  3. Basic types
    1. int, long vs. short, unsigned vs. signed
    2. char, treated like an int that holds 1 character
    3. float, double
    4. Type casting

  4. Basic operators
    1. arithmetic: +, -, *, /, %
    2. % defined so that n % p = r implies n = ap + r for some a
    3. 5 % −2 can be 1 (5 = (−2) × (−2) + 1) or −1 (5 = (−3) × (−2) + (−1))

  5. Associativity of operations
    1. Difference between associativity of operations and order of evaluation


Papers

  1. Compiling and Executing Your Program, compiling.pdf
  2. Writing a Program, writingprogram.pdf


UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 36A, Programming & Problem Solving
Version of March 30, 2025 at 7:21PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh