top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

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

0 votes
14,426 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...