top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use of \n \t \a \r \f in c/c++?

0 votes
16,276 views
What is the use of \n \t \a \r \f in c/c++?
posted Jul 16, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

\n for newline
\t for a tab
\a for a beep (alert)
\r for a carriage return
\f for clear the output - I means to say after printf performed it's job clear the screen.

answer Jul 17, 2014 by Rupam
0 votes

Following is the list of escape characters with explanation -

\a    Audible bell
\b    Backspace
\f    Formfeed
\n    Newline (linefeed)
\r    Carriage return
\t    Tab (horizontal)
\v    Vertical tab
\\    Backslash
\'    Single quote (apostrophe)
\"    Double quote
\?    Question mark
answer Jul 18, 2014 by Salil Agrawal
...