Pages

Wednesday, 2 January 2013

C Keywords or Reserve Word

Keywords or Reserve word:

       Keywords are the words whose meaning has already been explained to the c compiler ( or in a broad sense to the computer). The keywords are also called reserve words.
           The keywords can not be used as a variable name because if we do so we are trying to assign a new meaning to keywords which are not allowed by the computer. However it would be safer not to mix up the variable names and the keywords.

       auto     double     int      struct
       break   else         long    switch
      case       enum   register  typedef
      char       extern  return     union
     const      float    short      unsigned
    continue  for      signed     void
     default    goto   sizeof       volatile
       do        if        static       while


Note:

     Note that compiler vendor ( like Microsoft ,Borland etc) provides their own keywords a part from the ones mentioned above.These include extended keywords like near, far, asm etc.




The First C Program :

Armed with the knowledge about the types of variable, constant and keywords. The next logical step is to combine them to form instructions.
      However, instead of this we would write our first  C program now.

First Remember Some Rules:

  1)  Each instruction in a C program is written as a separate statement there fore a complete C program would comprise of a series of statements.
2) All statements are entered in a small case letters.
3) Every C statement must end with  a ( ;) act as a statement terminator.
  
       Let us write down our first c program :
Program no: 1


#include<stdio.h>
void main ()
 printf(" welcome to my home");

Program no: 2

#include<stdio.h>
void main ()
{
int a ;
a=10;
printf("%d",a);
}
     

No comments:

Post a Comment