Your Ad Here

Saturday, August 23, 2008

Operators

C is very rich in built-in operators. In fact, it places more significance on operators than do most
other computer languages. There are four main classes of operators: arithmetic, relational , logical,
and bitwise. In addition, there are some special operators, such as the assignment operator, for
particular tasks.
The Assignment Operator
You can use the assignment operator within any valid expression. This is not the case with most
computer languages (including Pascal, BASIC, and FORTRAN), which treat the assignment
operator as a special case statement. The general form of the assignment operator is
variable_name = expression;
where an expression may be as simple as a single constant or as complex as you require. C uses a
single equal sign to indicate assignment (unlike Pascal or Modula-2, which use the := construct).
The target, or left part, of the assignment must be an object, such as a variable, that can receive a
value.

No comments: