C10. C Printf

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 quo­tation marks.
printf doesn't automatically advance to the next output line when it fin­ishes 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 termi­nates the current output line; subsequent output goes onto the next line. To illus­trate 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: