Home Programming Fundamentals Using C Assignment Operator in C Programming

Assignment Operator in C Programming

25
0

Assignment operator is a binary operator. It acts on two operands. The expression on right hand side evaluates first and then that value is assigned to the operand on left hand side.


Example : int x = 5+3;

Assigns 8 to x.

 

Shorthand assignment operators are used to present a statement in a shorter way. Below table shows the list.

Original Statement Shorter Way Operator Name of Operator
a = a + b a += b += Addition Assignment
a = a – b a -= b -= Subtraction Assignment
a = a * b a *= b *= Multiplication Assignment
a = a/b a /= b /= Division Assignment
a = a%b a %= b %= Remainder Assignment

C Programming Tutorial in Odia Download Link

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here