Algorithm for Sum of two numbers

It's an algorithm for to find sum of two user defined numbers. *Not a program.

To add two numbers.
  1. Read the Value of A and B.
  2. SUM = A+B.
  3. Display SUM.
  4. Stop.
Similarly to Multiply two numbers.
  1. Read the Value of A and B.
  2. PRODUCT = A*B.
  3. Display PRODUCT.
  4. Stop.
For Divide two numbers.
  1. Read the Value of A and B.
  2. DIV = A/B.
  3. Display DIV.
  4. Stop.
For Subtract two Numbers.
  1. Read the Value of A and B.
  2. SUB = A-B.
  3. Display SUB.
  4. Stop.

* You can change SUM, PRODUCT, DIV amd SUB with your variables and note that you must to change the 3. Dispaly SUM / PRODUCT /DIV/ SUB.

Comments

Post a Comment

Popular posts from this blog

Algorithm to display "n" natural numbers #c

Algorithm to display the sum of n natural numbers #c