# Operators in C

Operators are the symbols which performs various operations on operands such as addition,subtraction,multiplications,divisions or modulus etc.

• Operators performs various mathematical operations.
• operands are which on which operators performs these operations.
• Operators performs operations and results stored into the variables (operands) as result value of expression.
• C provides various operators which are as follows:
1. Arithmetic operators
2. Increment and decrements operators
3. Logical operators
4. Bitwise operators
5. Assignment operators
6. Relational operators
7. Cast operators
• Arithmetic operators : Arithmetic operators are used to performs various Arithmetic operations on operands.Arithmetic operators must have two operands. Arithmetic operators are : + (addition) , -(subtraction), *(multiplication) , /(division), %(modulus)

Example :  a+b=c

• Increment and decrements operators : This operator used to add or subtract number by 1 Increment operator used to increment operand value by 1 and decrement operand used for decrements value by 1.We only require one operand for this.operator can be prefix or postfix that is  write operand after and before operators.

Increment ++ , Decrement —

1. Prefix operators : In this we write operators before the operands.that is value first increments before the result of expression.
2. Postfix operators : In this we write operators after the operands.that is value first increments after the result of expression.

Example : a++;

–b;

• Logical Operators : Logical operators used for performing logical operations such as Logical AND , Logical OR , Logical NOT.
1. Logical AND (&&) : This operator returns true if both operands are non zero.
2. Logical OR(||) : This operators returns true if either one of two operands are non zero.
3. Logical NOT(!) : This operators used to make condition reverse that is if condition true it returns false.
• Relational Operators : This operators used to check relation between the two operands.Relational operators are as follow:
1. < Less than
2. > greater than
3. <= Less than equal to
4. >=greater than equal to
5. == equal to
• Assignment Operators : This used for assigning the result to operand after expression solved.we assign result to operands which is at left end.Assignment operators are as follow:
1. = equal to
2. += Add and assign result to operand a+=b => a=a+b
3. -= subtract and assign result to operand a-=b => a=a-b
4. *= multiply and assign result to operand a*=b => a=a*b
5. /= divide and assign result to operand a/=b => a=a/b
• Bitwise Operator : This performs on bit present in each byte of variable.bit can be 0 or 1.bitwise operators are as follow:
1. ~ one’s complements
2. << left shift (Binary multiplication by 2)
3. >> Right shift (Binary divide by 2)
• Cast Operators :This used to convert a value of operands to another type that is int to float or any type.

Example : float(10);

C