decrement operator in c++ code example
Example 1: decrement c++
int x = 5;
x--;
cout << x << endl;
//outputs 4
Example 2: increment c++
int main(){
int i = 0;
cout << i << endl; //Outputs 0
i++; //Now i is 0 + 1
cout << i << endl; // Outputs 1
return 0;
}