Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

AlGORITHM

step 1 − START

step 2 − Display a message asking the user to enter the first number and store it in a
variable num1.

step 3 − Add num1 and num2 and store the result in sum_result.

step 4 − Display "The sum is: " followed by the value of sum_result.

step 5 − STOP

FLOWCHART
+-------------------+

| Start |

+-------------------+

+-------------------+

| Enter num1 |

+-------------------+

+-------------------+

| Enter num2 |
+-------------------+

+-------------------+

| Calculate sum |

+-------------------+

+-------------------+

| Display result |

+-------------------+

+-------------------+

| End |

+-------------------+

PYTHON CODE

# Addition program for grade 9

num1 = float(input("Enter the first number: "))

num2 = float(input("Enter the second number: "))


# Calculate the sum

sum_result = num1 + num2

# Display the result

print("The sum is:", sum_result)

You might also like