Ads 468x60px

Labels

Tuesday, 11 September 2012

C Pattern code

#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,k;
 clrscr();

C code for swapping of two numbers without using 3rd varible,+,-,*,/


#include<stdio.h>
#include<conio.h>
void main()
{
int x,y;
clrscr();
printf("\n enter the elements\n");
scanf("%d%d",&x,&y);
printf("\n before swaping x=%d,y=%d",x,y);
x=x^y;
y=y^x;
x=x^y;
printf("\n after swaping x=%d y=%d",x,y);
getch();
}

List of escape sequence in C:

An escape sequence is a character used in C which is not printed in Screen while printing it.It is a character combination consisting of a backslash (\) which is followed by a letter or a combination of digits.
Escape sequence is a single character and thus can be stored in a character constant.

List of escape sequence in C:
The following list contains a list of  escape sequence in ANSI C and their use:
\a is used to give an audible alert or beep sound.
\0 is used to print a null character.
\b is used to delete one character to the left of cursor , equivalent to backspace.
\f is used for form feed , or to feed a blank page when printing documents.
\t is used for horizontal tab , or to move the cursor to nest tab stop position.
\n is used for line feed , or to feed a blank line while printing documents.
\v is used for vertical tab , or to assign more space from the previous line.
\r is used for carriage return , or to move the cursor to the nest line during typing.
\\ is used to print a backslash.
\’ Is used to print a single quote.
\” is used to print a double quote.