April 27, 2018

C Operators and Expressions


   An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.

An operand is a data item on which an operator acts. Some operators require two operands, while others act upon only one operand.

An expression is defined as combination of both operator and operand.


Operator & Operands



Examples:

   7 + 10

Here, 7 and 10 are constants. The symbol '+' is an operator that indicates the operation to be performed and performs addition of numbers and is a single operator.

   int x=10;
   ++x;


In the above example the operator '++' is an increment operator. This operator adds one to the value of operand.


C includes a large number of operators that fall under several different categories, which are:

  • Arithmetic operators
  • Assignment operators
  • Increment and Decrement operators
  • Relational operators
  • Logical operators
  • Conditional operator
  • Comma operator
  • sizeof operator
  • Bitwise operators


Types of C Operators
C Operators





next    Arithmetic Operators in C
top    Index
prev    When scanf() Function Stop Scanning



1 comment: