Problem Statement - Increment, Decrement Composite Operators Problem 1
Show the output of the following program. Assume that required header files are present.
int main() { int n=10; cout<< n << endl ; cout<< ++n << endl ; cout<< n++ << endl ; cout<< n << endl ; cout<< - n << endl ; cout<< - - n << endl ; cout<< -- n << endl ; cout<< n << endl ; cout<< n-- << endl ; cout<< n << endl ; cout<< - --n <<endl; cout<< (n+=1) <<endl; cout<< (n-=1) <<endl; cout<< (n%=2) <<endl; return 0 ; }
Solution
CSKC| Created: 17-Dec-2017 | Updated: 18-Dec-2018|