Answer:
See explaination for program code.
Step-by-step explanation:
C++ programming language is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on.
C++ supports different ways of programming like procedural, object-oriented, functional, and so on. This makes C++ powerful as well as flexible.
Please kindly refer to attachment for a C++ programming code that performs the operation.