CodesJava

Easy learning with example program codes

C Escape Sequence


A sequence of characters starting with backslash ( \ ) that performs a specified function, which is already defined by C, is called as an escape sequence in C. It is named so as it doesn’t represent itself as a character, when it is used inside a string.

Some of the C Escape Sequence are listed below.

ESCAPE SEQUENCE USES
\a Alarm or Beep
\b Backspace
\\ Backslash
\r Carriage Return
\” Double Quote
\f Form Feed
\xhh Hexadecimal Number
\n New Line
\0 Null
\nnn Octal Number
\? Question Mark
\’ Single Quote
\t Tab (Horizontal)
\v Vertical Tab

 

Example:

#include <stdio.h>
 
void main()
{
printf ("\tI love my INDIA.\vINDIA is my Country.\nMy Country is my Identity.");
}

Output

I love my INDIA.                                                                                                             
                        INDIA is my Country.                                                                                         
My Country is my Identity.
Posted in C   
Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki