Monday, July 8, 2019

Escape Sequence


Escape  Sequence:

“\n” is a escape sequence. “\n” is an indication to the compiler that the cursor should be shifted to new Line.



Program

#include<stdio.h>
#include<conio.h>

void main()
{
clrscr();
 printf("My");


 printf("\n\tName is");
 printf("\n\t\tUmesh Patidar");
getch();
}

Output


In the above example \n is use for change the line and \t is equals to a “tab” or equals to 8 spaces.
The above example code is use the escape sequence . So “My” is printed on new line, “Name is” printed on another line with a tab space or 8 spaces, and “Umesh Patidar” is printed on next line with 2 tab space or 8*2 spaces.

0 comments: