Outline for April 3, 2002
Handouts: Sample Basic C Programs
Reading: Johnsonbaugh & Kalin pp. 31-63
-
Greetings and felicitations!
-
fahr1.c
-
program (main, return or exit for main)
-
declarations (int, register int)
-
body (while, functions; printf)
-
Basic operators
-
arithmetic: +, -, *, /, %
-
% defined so that n
% p = r
implies n = a * p
+ r for some a
-
5 % -2 can be 1 (5 = -2 * 3 + 1) or -1 (5 = -2 * 2 + -1)
-
fahr2.c
-
macros
-
include <stdio.h>