Printing
Strings
printf is a powerful function So
far. we've only used printf to
display a string literal a series of characters enclosed in double
quotation marks. When printf
displays a string literal, it doesn't show the quotation marks.
printf doesn't
automatically advance to the next output line when it finishes printing. To instruct printf to advance one line, we must
include \n (the new-line
character) in the string to be printed. Writing a new-line character terminates
the current output line; subsequent output goes onto the next line. To illustrate
this point, consider the effect of replacing the statement
printf(“To
C, or not to C: that is the question.\n”);
by two calls of
printf:
printf(“To C, or not to C: “);
printf(“that is the question.\n”);
No comments:
Post a Comment