C++ examples for Operator:Increment and decrement operators
Demonstrates the increment operator
#include <iostream> using namespace std; int main()//from ww w .j av a2 s. c o m { int count = 10; cout << "count=" << count << endl; //displays 10 cout << "count=" << ++count << endl; //displays 11 (prefix) cout << "count=" << count << endl; //displays 11 cout << "count=" << count++ << endl; //displays 11 (postfix) cout << "count=" << count << endl; //displays 12 return 0; }