Sunday, 24 April 2016

Escape sequences //

hello guys , today i m gonna tell u about what are  escape sequence in C language ....


so here are the list of escape sequences we are gonna discuss about:

1, \n

2. \a

3. \r

4. \b

5. \t

/n = new line

some times we need to print anything using printf function in two lines . even if we use 2 printf without using \n we cant print anything in two line...
so if we want to print anything in two lines we have to use /n 
for example if we want to print 

hello 
user

soo program will be like



#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
 printf("hello\n user");

 getch();
}

sooo backslash n (\n) shifts our cursor to the next line.....

\a = alarm 

sometimes we want to seeks users attention.....soo \a  allow us to do sooo...
when we use \a in printf.....\a generates a beep sound using our cpu buzzer ..
suppose we have instructed as follows:

printf("hello \a user ");

then output will be like 

hello (beep sound) user



                                                                                             to be continued .... 





0 comments:

Post a Comment