exercisearithmethis ass

exercisearithmethis ass - n*=2; // multipilies n by 2 cout...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> using namespace std; void main() { // test arithmetic assignment operator: int n=22; cout << "n="<<n<<endl; n+=9; // adds 9 to n cout << "After n +=9, n="<<n<< endl; n-=5; // subtracts 5 from n cout << "After n -=5, n="<<n<< endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n*=2; // multipilies n by 2 cout << "After n *=2, n="<<n<< endl; n/=3; // divides n by 3 cout << "After n /=3, n="<<n<< endl; n%=2; // reduces n to the remainder from dividing by 7 cout << "After n %=7, n="<<n<< endl; } Output...
View Full Document

This note was uploaded on 07/27/2011 for the course COL 201 taught by Professor Magtibay during the Winter '10 term at De La Salle Lipa.

Ask a homework question - tutors are online