Design an algorithm to find the greater number by taking two numbers as input
Answers
Answered by
2
Heyo!
Algorithm:
- Start.
- Require a, b
- if a > b
- Print "A is the greater number"
- else
- Print "B is the greater number"
- Exit
Hope this helps you!
Answered by
2
Answer:
Step 1: Start
Step 2: Declare 2 variables n1 and n2
Step 3: Read the 2 numbers n1 and n2
Step 4: If n1 > n2, then
Print n1 is the greatest number
Step 5: Else
Print n2 is the greatest number
Step 6: Stop
Explanation:
What is an Algorithm?
An algorithm is a set of well-defined instructions for solving a problem. It is the set of instructions that the programmer creates before building the program code.
Features of an Algorithm:
- Well-defined instructions
- Finite number of steps
- Steps are precisely stated
- Receives an input and produces output
- Can be applied to any programming language
Advantages of Algorithm:
- Step-by-step instructions makes it easy to understand
- Easy to debug
- Not specific for a particular programming language
Learn more about Algorithms:
https://brainly.in/question/5243751
https://brainly.in/question/33325954
Similar questions