#Meta-Wlp:
#Macro: TITLE wlp: Learn C (III) p. 11
#Eval: $TITLE$
#Macro: PAGE bb3-11
Congratulations!
You have come very far in your knowledge of C.
Review
- Expressions evaluate to a value. Examples are: arithmetic
expressions such as + and *;
assignment expressions such as = and +=; and logical expressions
such as == and &&.
- Assignment statements are assignment statements followed by
a semicolon.
- Compound statements are series of statements enclosed
in curly braces.
- The while statement repeatedly runs its following compound
statement or single statement until its control expression is false.
- The if statement runs its following compound statement or
statement if its control expression is true.
- Variables are declared before used.
Two types of variables are int (integer) and char (character).
- Sequences of characters are located using a reference to character,
char-star. A reference to character is also called a pointer.
- Strings can be referenced using char-star, but they always
are terminated by a end-of-string marker.
- printf is in library stdio.h. Its first argument
is a format string. Special characters, introduced by a %,
control the substitution into the format string of the remaining
arguments after the format string argument.
Exercises
- Write a program which prints out all the integers-cubed less than 100.
- Write a program that prints continues this pattern up to a line
length of 72 characters:
ab
aabbab
aaabbbaabbab
Learn C Introduction