// Dave Goldsmith // Redwood High School // C++ Computer Programming // September 11, 1999 // AssignmentOperator3.cpp /* This program demonstrates an application of the assignment operator %=. In this example, a runtime error will occur since division by zero takes place. The statement that causes the error, j %= i - i, could also be written as j = j % (i - i), which makes it easier to see why division by zero takes place. */ #include // Required for 'cin' and 'cout' int main() { int i=4, j=5; j %= i - i; cout << j << endl; cout << i << endl; return 0; }