#include <iostream>
using namespace std;
int main( ) {
int num = 5 , i = 3 ;
cout << "num = " << num << "; i = " << i << endl;
i = num++ + 2 ;
cout << "num = " << num << "; i = " << i << endl;
cout << "---------------------------------" << endl;
num = 1 ;
cout << "before post-increment\t " << num << endl;
cout << "post-increment:\t \t \t " << num++ << endl;
cout << "after post-increment:\t " << num << endl;
cout << "---------------------------------" << endl;
num = 1 ;
cout << "before pre-increment\t " << num << endl;
cout << "pre-increment:\t \t \t " << ++ num << endl;
cout << "after pre-increment:\t " << num << endl;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbnVtID0gNSwgaSA9IDM7Cgljb3V0IDw8ICJudW0gPSAiIDw8IG51bSA8PCAiOyBpID0gIiA8PCBpIDw8IGVuZGw7CglpID0gbnVtKysgKyAyOwoJY291dCA8PCAibnVtID0gIiA8PCBudW0gPDwgIjsgaSA9ICIgPDwgaSA8PCBlbmRsOwoJCgljb3V0IDw8ICItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iPDwgZW5kbDsKCW51bSA9IDE7Cgljb3V0IDw8ICJiZWZvcmUgcG9zdC1pbmNyZW1lbnRcdCIgPDwgbnVtIDw8IGVuZGw7Cgljb3V0IDw8ICJwb3N0LWluY3JlbWVudDpcdFx0XHQiICAgPDwgbnVtKysgPDwgZW5kbDsKCWNvdXQgPDwgImFmdGVyIHBvc3QtaW5jcmVtZW50Olx0IiA8PCBudW0gPDwgZW5kbDsKCQoJY291dCA8PCAiLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIjw8IGVuZGw7CgludW0gPSAxOwoJY291dCA8PCAiYmVmb3JlIHByZS1pbmNyZW1lbnRcdCIgPDwgbnVtIDw8IGVuZGw7Cgljb3V0IDw8ICJwcmUtaW5jcmVtZW50Olx0XHRcdCIgPDwgKytudW0gPDwgZW5kbDsKCWNvdXQgPDwgImFmdGVyIHByZS1pbmNyZW1lbnQ6XHQiIDw8IG51bSA8PCBlbmRsOwoKCXJldHVybiAwOwp9