Q:

Write a C program to demonstrate example of escape sequences

0

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

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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!

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C programming Basic Input, Output, if else, Ternary Operator based Programs

Similar questions


need a help?


find thousands of online teachers now
Write a C program to find area and perimeter of ci... >>
<< Write a C program to print size of variables using...