Learn to use the C Reference Card.
The first exam covers Chapters 1 to 8 of the textbook. The emphasis is on reading C or writing short sections of C, similar to those you've done in the CodeLab homework.
The first exam will concentrate on the elements of C covered in the CodeLab homeworks and in Assignments 1 and 2.
| Class | Example | Associativity |
|---|---|---|
| Unary postfix | ++, -- |
Right to left |
| Unary prefix |
+, -, !, (type),
sizeof, ++, --
|
Left to right |
| Multiplicative |
*, /, %
|
Left to right |
| Binary additive |
+, -
|
Left to right |
| Comparative binary |
<, >,
<=, >=
|
Left to right |
| Equality binary |
==, !=
|
Left to right |
| Logical and |
&&
|
Left to right |
| Logical or |
||
|
Left to right |
| Ternary conditional |
? |
|
Right to left |
| Assignment operator |
=, =*, =/, =%,
=+, =-
|
Right to left |
| Comma (sequencing) |
,
|
Left to right |
printf and scanf onlywhile loopsfor loopsif statementif-else statementswitch statement
casedefaultbreakmainprintfscanf
&getcharputcharscanf and getcharscanfscanf