Computer Science, asked by AyushmanDas7588, 7 hours ago

Design an algorithm to find the greater number by taking two numbers as input

Answers

Answered by MichMich0945
2

Heyo!

Algorithm:

  1. Start.
  2. Require a, b
  3. if a > b
  4. Print "A is the greater number"
  5. else
  6. Print "B is the greater number"
  7. Exit

Hope this helps you!

Answered by anurimasingh22
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