C++ program to overload prefix and postfix decrement operator by using friend function

 

Sample Output
Before prefix decrement a=5and b=-5
After prefix decrement a=4and b=-6
Before postfix decrement a=5and b=-5
After postfix decrement a=4and b=-6

You may also like...