Lecture 4: April 10, 2023

Reading: zyBooks text, §3.1–3.12, 3.16–3.19; [5]


  1. True and false in C

  2. Relations and conditionals
    1. <, <=, >, >=, ==, !=
    2. &&, ||, !

  3. Conditional statements
    1. if
    2. if … else
    3. Nested ifs
    4. The right way to do this
    5. switch

  4. Reading input make_change.c
    1. Usability: prompt for amount
    2. scanf

  5. Error handling make_change_cp.c
    1. if statement
    2. Back to program

Handouts

  1. Precedence and Associativity of C Operators, associativity.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 April 10, 2023 at 2:34PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh