Outline for April 2, 2025
Reading:
zyBook
§1, 2.20;
handouts
3, 4
Due:
Homework #1, due April 14, 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
Compiling and Executing Your Program,
compiling.pdf
Writing a Program,
writingprogram.pdf
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.