Use increment operator. - C++ Operator

C++ examples for Operator:Increment and decrement operators

Description

Use increment operator.

Demo Code

#include <iostream>
using namespace std;
int main()//from   w w  w.  j a va2  s.  c  o m
{
   int count;
   count = 0;
   cout << "The initial value of count is " << count << endl;
   count++;
   cout << "   count is now " << count << endl;
   count++;
   cout << "   count is now " << count << endl;
   count++;
   cout << "   count is now " << count << endl;
   count++;
   cout << "   count is now " << count << endl;
   return 0;
}

Result


Related Tutorials