Assignment operators in C Language with examples
Assignment operators in C
- #include <stdio.h>
- int main() {
- int a, b, c, d, e; // variable declaration
- a = b = c = d = e = 100; // assign 100 to a, b, c, d & e
- a += 10; // a = a + 10
- printf("Value of a is %d\n", a);
- b -= 10; // b = b - 10
- printf("Value of b is %d\n", b);
- c *= 10; // c = c * 10
- printf("Value of c is %d\n", c);
- d /= 10; // d = d / 10
- printf("Value of d is %d\n", d);
- e %= 10; // e = e % 10
- printf("Value of e is %d\n", e);
- return 0;
- }
OUTPUT
Comments
Post a Comment