Increment, Decrement Composite Operators Problem 1 – CSKC
Sign In

Search

Solved Problem #CPP#1756    siteicon   siteicon  

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

TC++ #1756

 

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP


Share

Created: 17-Dec-2017 00:32 | Updated: 22-Mar-2026 20:17|