/* testops1.cpp CIS 150 6/2/2005 David Klick Examples of combination arithmetic operators. */ #include using std::cout; int main(void) { int n = 5; cout << "n: " << n << '\n'; n += 7; cout << "after n += 7: " << n << '\n'; n -= 2; cout << "after n -= 2: " << n << '\n'; n *= 3; cout << "after n *= 3: " << n << '\n'; n /= 5; cout << "after n /= 5: " << n << '\n'; n %= 4; cout << "after n %= 4: " << n << '\n'; return 0; } /* Sample output: n: 5 after n += 7: 12 after n -= 2: 10 after n *= 3: 30 after n /= 5: 6 after n %= 4: 2 */