C – Assignment Operator

C – Assignment Operator 2017-08-05T17:47:24+00:00

Assignment Operator :

An Assignment operator is used to form an assignment expression, which assigns the value to an identifier. The most commonly used assignment operator is = . Assignment expressions that make use of this operator are written in the form<
Identifier=expression;
Example:
i=100;
j=200;

Other forms of assignment operators exist that are obtaining various operators such as +,-,*,/,% etc with the = sign.

 operator Equation Output
+= i=i+1 i+=1
-= i=i-10 i-=10
*= i=i*11 i*=11
/= i=i/12 i/=12
%= i=i%5 i%=5

C – ASSIGNMENT OPERATORS EXAMPLE PROGRAM :

Output:

Value of a = 123

Value of b = 125

Prev Next