Assignment Operators In C Language

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

In C programming, assignment operators are used to assign values to variables. Here are the most common assignment operators used in C:

  • = : assignment operator. It assigns the value of the right operand to the left operand.

Copy code

int x = 5, y; y = x;

This will assign the value of x (5) to y.

  • += : addition assignment operator. It adds the value of the right operand to the value of the left operand and assigns the result to the left operand.

Copy code

int x = 5, y = 3; x += y;

This will add the value of y (3) to x (5) and assigns the result to x, resulting in x = 8.

  • -= : subtraction assignment operator. It subtracts the value of the right operand from the value of the left operand and assigns the result to the left operand.

Copy code

int x = 5, y = 3; x -= y;

This will subtract the value of y (3) from x (5) and assigns the result to x, resulting in x = 2.

  • *= : multiplication assignment operator. It multiplies the value of the left operand by the value of the right operand and assigns the result to the left operand.

Copy code

int x = 5, y = 3; x *= y;

This will multiply the value of x (5) by the value of y (3) and assigns the result to x, resulting in x = 15.

  • /= : division assignment operator. It divides
4. Operators

Comments: 0

Frequently Asked Questions (FAQs)

How do I register on Sciaku.com?
How can I enroll in a course on Sciaku.com?
Are there free courses available on Sciaku.com?
How do I purchase a paid course on Sciaku.com?
What payment methods are accepted on Sciaku.com?
How will I access the course content after purchasing a course?
How long do I have access to a purchased course on Sciaku.com?
How do I contact the admin for assistance or support?
Can I get a refund for a course I've purchased?
How does the admin grant access to a course after payment?