You are on page 1of 1

A simple calculator

You are required to develop a calculator program as follows:

At the start user should be shown following menu

 For addi on opera on press 1


 For subtrac on opera on press 1
 For mul plica on opera on press 1
 For division opera on press 1
 To exit press any other key

If user presses 1 then

 User should be asked to enter two numbers separated by comma. Your program should then
display the sum of the numbers entered by the user
 Display following menu to the user
o To repeat the opera on press 1
o Press any other key to go to main menu

If user presses 2 then

 User should be asked to enter two numbers separated by comma. Your program should then
display the result of subtrac on for the numbers entered by the user
 Display following menu to the user
o To repeat the opera on press 1
o Press any other key to go to main menu

If user presses 3 then

 User should be asked to enter two numbers separated by comma. Your program should then
display the product of the numbers entered by the user
 Display following menu to the user
o To repeat the opera on press 1
o Press any other key to go to main menu

If user presses 4 then

 User should be asked to enter two numbers separated by comma. Your program should then
display the result of the division of the numbers entered by the user
 Display following menu to the user
o To repeat the opera on press 1
o Press any other key to go to main menu

If user presses any other key then the program exits.

You might also like