The program takes in two numbers and an operator from the user and performs the calculation based on the operator entered. It uses a switch statement to check the operator and perform the appropriate calculation, printing the result. If an invalid operator is entered, it prints an error message.