Arithmetic Operators in C Language Examples


Arithmetic Operators in C Language Examples 


In this topic of Arithmetic Operators in C Language Examples , we will list arithmetic operators available in C Language. Like other programming languages, C Language also have arithmetic operators to perform various arithmetic operations like addition, subtraction, division , multiplication and exponentiation. We do not have exponentiation operator in C Language.


Lets us explore all the C Language arithmetic operators one by one.


Operator for Addition in C Language

To perform addition operation we need plus operator. The operator for addition is ( + ) sign.


Suppose you wants to add two variables say A and B and result of the addition is to be stored in variable C.

C=A+B


Operator for Subtraction in C Language

To perform subtraction operation we need minus operator. The operator for subtraction is ( - ) sign.


Suppose you wants to subtract value of  variable A from variable  B and result of the subtraction is to be stored in variable C.

C=B-A


Operator for Multiplication in C Language

To perform multiply operation we need multiplication operator. The operator for multiplication is ( * ) sign.


Suppose you wants to multiply value of  variable A with value of  variable  B and result of the multiplication is to be stored in variable C.

C=A*B
Operator for Division in C Language

To divide value of a variable by value of some other variable we need division operator . The operator for division is ( / ) sign.

Suppose you wants to divide value of  variable A by the value of  variable  B and result of the division is to be stored in variable C.

C=A/B

Modulus Operator of C Language

Modulus operator of C Language is (%). 
When a number is divided by another number , the modulus operator returns remainder of this division.