Assignment Operators in C Programming

Assignment Operators

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 operator 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

Example:

Ready to get started?

Ready to embark on your journey into the world of C programming? Our comprehensive course provides the perfect starting point for learners of all levels. With engaging lessons, hands-on exercises, and expert guidance, you'll gain the skills and confidence needed to excel in this fundamental programming language. Let's dive in and unlock the endless possibilities of C programming together!