C++ Arithmetic Operator assignment and decrement

Description

C++ Arithmetic Operator assignment and decrement

#include <iostream>
using namespace std;
int main()/*from   w  ww  .ja va 2s .c  o m*/
{
   int var = 10;
   cout << var << endl;      // var is 10
   var *= 2;                 // var becomes 20
   cout << var-- << endl;    // displays var, then decrements it
   cout << var << endl;      // var is 19
   return 0;
}



PreviousNext

Related