Tuesday 16 February 2021

Lec1: Printf Format specifier part 1

Printf Format specifier part 1 


The \n used in the printf statements is called an escape sequence. In this case it represents a newline character. After printing something to the screen you usually want to print something on the next line. If there is no \n then a next printf command will print the string on the same line. Commonly used escape sequences are:

  • \n (newline)
  • \t (tab)
  • \v (vertical tab) —remaining 
  • \f (new page) — remaining
  • \b (backspace) —remaining
  • \r (carriage return) —remaining 
  • \n (newline)
  • //
  • \\
  • \’
  • \”
  • \%

Program:


No comments:

Post a Comment