ADVERTISEMENT
ADVERTISEMENT

C program to demonstrate example of escape sequences

This program will demonstrate example of escape sequences, here you will learn how to use escape sequences to print special characters like new line, tab space, inverted commas etc in printf statements.

    Most popular Escape Sequences

    \\	\
    \"	"
    \'	'
    \?	?
    \a	Alert
    \b	Back space 
    \n	New Line
    \t	Horizontal tab
    \v	Vertical tab
    \r	Carriage return

Escape sequences example program in c

/*C program to demonstrate examples of escape sequences.*/
 
#include <stdio.h>
int main()
{
     
    printf("Hello\nWorld!");    //use of \n
 
    printf("\nHello\tWorld!");  // use of \t
 
    printf("\n\"Hello World!\"");   //use of \"
 
    printf("\nHello\bWorld!");      //use of \b
    return 0;
}

Output

    Hello
    World!
    Hello   World!
    "Hello World!"
    HellWorld!

C Basic Programs »



ADVERTISEMENT




ADVERTISEMENT



Comments and Discussions!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.