This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Friday 27 September 2013

BASIC ELEMENTS IN C



BASIC ELEMENTS IN C:

The C language is composed of the following basic types of elements:
constants, identifiers, operators, punctuation, and keywords

These elements are collectively known as tokens. A token is a source program text that the compiler does not break down into component elements.

Consider the statement:
number = number + 1;

The tokens are,
number
-
identifier (variable)
=
-
operator
+
-
operator
1
-
constant
;
-
punctuation

The above statement has a collection of tokens such as identifier, constant, operator etc. The words like if, while, for etc., are termed as keywords in C programming language and their usage is restricted to specific purposes.

No comments:

Post a Comment