/= Assignment Operators in C, Modulus AND assignment operator. It takes modulus using two operands and assigns the result to the left operand.
C Programming Language Operators and Enums in C Language (Article) Operators and Enums in C Language (Program)
1288Program:
//Assignment operator #include"stdio.h" void main() { int a = 2; int c = 12 ; c %= a; // c=c%a c=12%2=0 printf(" %= Operator Example\n Value of c = %d \n", c ); c = 11 ; c %= a; // c=c%a c=11%2=1 printf(" %= Operator Example\n Value of c = %d \n", c ); }
Output:
/= Operator Example Value of c = 0 = Operator Example Value of c = 1 Press any key to continue . . .
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.