# C++ Program using Increment Operator

The values of variables can be incremented using ++ operator. And the value can be decremented using — operator. You can either pre-increment or post-increment the values.

#include<iostream>
using namespace std;
int main(){
int a = 30;
int b;
cout<<"a = "<<a<<" b = "<<b<<endl;
b = a++;
cout<<"a = "<<a<<" b = "<<b<<endl;
a = 30;
b = ++a;
cout<<"a = "<<a<<" b = "<<b<<endl;
return 0;
}

You should use decrement operator — to reduce the value.