Showing posts with label C Language. Show all posts
Showing posts with label C Language. Show all posts

Wednesday, 1 August 2012

Identifier



  • Identifier:-
                     The unique names used in the program to represent the variables, constants, functions and labels etc. are called Identifiers. You can use any number of characters for the name of an identifier but only the first 31 characters are significant to the C compiler. 

  • Types of Identifiers:-
              There are two types of identifiers in C. These are:

  1. Standard Identifier
  2. User-Defined Identifier

Token


  • Token:-
               In C-language, a source program consists of keywords, variables (or identifiers), constants, operators, punctuators etc. These elements of a program known as tokens.

  • For Example:-
                    main()
                    {
                          float temp, xy4;
                          xy4 = 10;
                          temp = xy4 + 10 * 2;
                    }


                 In the above program;

  1. ''main'' is a special identifier and temp, xy4 are variables.
  2. ''float'' is a keyword.
  3. The punctuators are; { , " , '' , ( , ) , ; , white spaces etc.
  4. The operators are : , = , *  , + , etc.

Keywords of C language


  • Keyword:-
            The predefined words of the C-language that are used for special purposes in the source program are called keywords. Keywords are also known as reserved words. 
  • For Example:-
  keyword "int" is used to define the integer type variables.


                Each keyword has certain meanings in C language. They cannot be redefined or used in other ways. They cannot be used as variable or function names. Keywords are always written in lowercase's. There are 32 keywords in C.
    The ''main'' is not the keyword. It is a special identifier that indicates the beginning of the program.

  • C LANGUAGE KEYWORDS:-



Tuesday, 31 July 2012

Character Set of C


  • Character Set of C:-
                              Every programming language has its own set of characters which are used to write the statements of the program (source code). In C language also, a program is written by using a set of characters. These characters are known as alphabet or character set of C. The alphabet of C language is given below.
  1. Lowercase letters: a, b, c, ........, z
  2. Uppercase letters: A, B, C, ............, Z
  3. Digits: 0, 1, 2, ............, 9
  4. Special characters: +, -, /, =, (, ), [, ], {, }, <, >, ', ", !, @, #, $, %, \, /, ;
  5. White Spaces: blanks, new line, tab etc.

Tuesday, 3 January 2012

Source Code & Object Code



  • Source Code:-
                                      The Program instructions written by following the rules of any High Level Language are known as Program Source Code. The source code is like English statements but the computer understands only the instructions in Machine code.
  • Object Code:-
                              A computer understands only the machine code. The source program written in any High Level Languages (and assembly language) must be translated into machine code before running it on the computer. The translated program into machine code is known as Program Object Code.