Q2. Write an algorithm and flow chart to find the smallest among three numbers.
Answers
Answer:
Explanation:
An algorithm is a step by step method of solving a problem. It is commonly used for data processing, calculation, and other related computer and mathematical operations. An algorithm is also used to manipulate data in various ways, such as inserting a new data item, searching for a particular item or sorting an item. An algorithm is a detailed series of instructions for carrying out an operation or solving a problem. In a non-technical approach, we use algorithms in everyday tasks, such as a recipe to bake a cake or a do-it-yourself handbook.
Algorithm to Find the Smallest of three Numbers
1. Declare three variable a, b, c.
2. Compare a with b and c. If a is smaller than b and c than a is smallest among three numbers.
3. Compare b with a and c. if b is smaller than a and c than b is smallest among three numbers.
4. Else c is smallest among three numbers.
Flowchart to find the smallest of three numbers