It performs basic four mathematical operations (addition, subtraction, multiplication, and division) depending on the user’s choice, use the ‘switch’ case to identify the input operator to perform required calculation then display the result as shown here in the following program.

This program takes two operands from user and performs the calculation on the two operands depending upon the operator entered by the user.