C Operators

C Programming Operators

An operator is a symbol that instructs C to perform some operation, or action, on one or more operands. An operand is something that an operator acts on. In C, all operands are expressions. C operators fall into several categories:

1) The assignment operator.

2) Mathematical operators.

3) Relational operators.

4) Logical operators.

The assignment operator

The assignment operator is the equal sign (=). Its use in programming is somewhat different from its use in regular math.If you write ….

``x = y;``

in a C program, it doesn’t mean “x is equal to y.” Instead, it means “assign the value of y to x.” In a C assignment statement, the right side can be any expression, and the left side must be a variable name.

Mathematical operators

C’s mathematical operators perform mathematical operations such as addition and subtraction. C has two unary mathematical operators and five binary mathematical operators.

``````The Unary Mathematical Operators
Increment ++ Increments the operand by one ++x, x++
Decrement -- Decrements the operand by one --x, x--``````
``````  The binary mathematical operators