Computer Science, asked by Vikashzeus6656, 1 month ago

Write an algorithm and make a flowchart to find the sum of two number and difference of two number compare their sum and difference. if sum > difference then print sum, otherwise print difference.

Answers

Answered by ss2371489
0

Answer:

How do I make an algorithm of the sum of two numbers?

An algorithm is a set of well-defined instructions in sequence to solve a problem.

Some good qualities of an algorithm are:

Input and output should be defined precisely.

Each step in the algorithm should be clear and unambiguo

Produces desired output.

General flow of an algorithm is Start → Declare variables → Initialise variables → Perform operation → Display output → Stop.

Now, algorithm for sum of two numbers is as follows:

Step 1: Start

Step 2: Declare variables num1, num2 and sum.

Step 3: Read values for num1 and num2.

Step 4: Add num1 and num2 and assign the result to sum.

sum=num1+num2

Step 5: Display sum

Step 6: Stop

Similar questions