Quick Print – CSKC
Sign In

Search

siteicon
Solved Problem! #CPP#2346 Back

Problem Statement - Output writing – loop with unary operators in cout chain

Solve the following program to show its output. Assume that required header files are included

int main() 
{
  int a,b;
  a=(b=10);
  for(int i=10;i<30;i+=10)
  {
    cout<<a++ + i<<" "<<(b=++b -i)<<endl ;
  } 
  return 0;
}

Solution

		 

Run Output

20 1
31 -18