Ads 468x60px

Labels

Wednesday, 12 September 2012

Simplified pattern code

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,a=4;
clrscr();
for(i=0;i<5;i++)
{
for(j=0;j<9;j++)
{
if((j>7-i||j<i+1)
printf("%d ",a);
else
printf("  ");
}
printf("\n");
a--;
}
getch();
}

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.

Thursday, 6 September 2012

Understanding C program execution

Animation of program execution
This animation shows the execution of a simple C program. By the end of this article you will understand how it works!
The C programming language is a popular and widely used programming language for creating computer programs. Programmers around the world embrace C because it gives maximum control and efficiency to the programmer.
If you are a programmer, or if you are interested in becoming a programmer, there are a couple of benefits you gain from learning C:
  • You will be able to read and write code for a large number of platforms -- everything from microcontrollers to the most advanced scientific systems can be written in C, and many modern operating systems are written in C.

The-C-programming-language-Ritchie-Kernighan

Dennis Ritchie



Object Oriented Programming With C++ By Balagurusamy

 E. Balagurusamy