Skip to main content

Design a Flowchart to subtract two numbers

Description

The flowchart starts with the beginning of the process, followed by the declaration of variables to store values. Input is obtained for the numbers to be subtracted. The difference between the numbers is calculated and stored. The program then displays the calculated difference. The process ends, signifying the completion of the program.

Flowchart

What does this mean ?

  • START → Indicates the beginning of the process, where the program starts its execution.
  • Declare n1, n2 and DIFF → Indicates the declaration of three variables: n1, n2, and DIFF. These variables are used to store the values of the two numbers to be subtracted and their difference.
  • Read (input) n1 and n2 → Indicates the input of the two numbers to be subtracted. The program asks the user to enter the values of n1 and n2 and stores them in the respective variables.
  • DIFF = n1 - n2 → Indicates the calculation of the difference between n1 and n2 and storing it in the variable DIFF. The program subtracts the value of n2 from the value of n1 and stores the result in the variable DIFF.
  • Display (output) DIFF → Indicates the output of the difference between n1 and n2. The program displays the value of DIFF on the screen or prints it on a paper.
  • STOP → Indicates the end of the process, where the program stops executing.

Learn more

Reference