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 »


Related Programs

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.