Search This Blog

Thursday, 14 March 2013

Operators in c

An operator is a special symbol that performs specific operation on operands.
For example int a=10

Int  b=a+20;

Here a and 20 are operands and + is the operator performing Addition operation.

Note: Operands may be variables or constants on which operator performs operations.

Types of operators

In C operators can be classified into various categories based on their usage they are as follows

  1. Arithmetic Operators 
  2.  Relational Operators
  3.  Logical Operators
  4.  Assignment operator
  5.  Conditional operator
  6.  Size of Operator
  7.  Bitwise Operators.
Arithmetic Operators:

Arithmetic Operators can be used to perform mathematical calculations .These operators re categorized into Two types they are as follows

  1.  Binary arithmetic operators
  2. Unary arithmetic operators

Binary arithmetic operators

Binary Operators are those Operators it requires two operands to perform operation. Generally these operators are categorized into 5 types as shown below



Operator
Meaning
Example
+
Addition
 a+b
-
Subtraction
a-b
*
Multiplication
a*b
%
Modulo
a%b
/
Division
a/b
%
Modulo
a%b


0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hostgator Discount Code