Professional Documents
Culture Documents
Output: Welcome to C!
THE OUTPUT STATEMENT
The following line instructs the computer to perform an action,
namely to print on the screen the string of characters marked by
the quotation marks.
Output: Welcome to C!
ESCAPE SEQUENCES: EXAMPLE 2
Output: Welcome
to C!
ESCAPE SEQUENCES: EXAMPLE 3
Output: Welcome
to
C!
QUESTION: STATE WHETHER THE FOLLOWING
STATEMENTS ARE TRUE/FALSE. IF FALSE, EXPLAIN WHY.
1. Function printf always begins printing at the beginning of a new
line.
2. Comments cause the computer to display the text after // on
the screen when the program is executed.
3. The escape sequence \n when used in a printf format control
string causes the cursor to position to the beginning of the next
line on the screen.
4. A program that prints three lines of output must contain three
printf statements.
QUESTION: WRITE A C PROGRAM TO PRINT THE
FOLLOWING OUTPUT.
A SIMPLE C PROGRAM: PRINTING A VARIABLE
Output: 10
PRINTING WITH A FORMAT CONTROL STRING