You are on page 1of 2

SIMPLE CALCULATOR WITH LOOP ALGORITHM

STEP 1: Start
STEP 2: Declare Variables
float num1,num2,result;
int choice
STEP 3: PRINT MENU:
SELECT OPERATION
[1] Multiplication
[2] Division
[3] Addition
[4] Subtraction
[5] Exit
STEP 4: GET CHOICE
STEP 5: CHECK CHOICE
STEP 5.1: if choice == 1
Get user input for num1 and num2
result = num1 * num2
PRINT RESULT
GO BACK TO START
STEP 5.2: if choice == 2
Get user input for num1 and num2
result = num1 * num2
PRINT RESULT
GO BACK TO START
STEP 5.3: if choice == 3
Get user input for num1 and num2
result = num1 * num2
PRINT RESULT
GO BACK TO START
STEP 5.4: if choice == 4
Get user input for num1 and num2
result = num1 * num2
PRINT RESULT
GO BACK TO START
STEP 5.5: if choice == 5
EXIT
STEP 6: END

FLOW CHART
START

float num1, num2, result;


int choice;

SWITCH CHOICE

Case 1

SELECT OPERATION
[1] Multiplication
[2] Division
[3] Addition
[4] Subtraction
[5] Exit
INPUT CHOICE:

Input num1 &


num2

Case 2 Input num1 &


num2

Case 3

Case 4

Input num1 &


num2

Input num1 &


num2

Case 5
END

result = num1 *
num2

PRINT result

result = num1 /
num2

PRINT result

result = num1 +
num2

PRINT result

result = num1 num2

PRINT result

You might also like