Page 38 - 6437
P. 38
c /=
a; - /= Operator Example, Value of c = %d\n", c );
printf("
Line
c
= 200;
c %=
a; - %= Operator Example, Value of c = %d\n", c );
printf("Line
c <<=
2; - <<= Operator Example, Value of c = %d\n", c );
printf("
Line
c >>=
2; - >>= Operator Example, Value of c = %d\n", c );
printf("
Line
c &=
2; - &= Operator Example, Value of c = %d\n", c );
printf("Line
c ^=
2;
printf("Line 10 - ^= Operator Example, Value of c = %d\n", c );
c |= 2;
printf("Line 11 - |= Operator Example, Value of c = %d\n", c );
}
When you compile and execute the above program, it produces the following result:
Op Ex
ine = erator ample, alue f 1
Op Ex
ine += erator ample, alue f 2
Op Ex
ine -= erator ample, alue f 1
Op Ex
ine *= erator ample, alue f 41
Op Ex
40
Line 7 - <<= Operator Example, Value of c = 44
Line 8 - >>= Operator Example, Value of c = 11