Computer Science, asked by Anonymous, 7 months ago

write an algorithm to find the greater number between two number​

Answers

Answered by Anonymous
80

Answer:

Algorithm, Flowchart and Program code to print the larger of two numbers

  1. Step 1: Start.
  2. Step 2: Read a, b . / * a, b two numbers */
  3. Step 3: If a>b then /*Checking */
  4. Display “a is the largest number”.
  5. Otherwise.
  6. Display “b is the largest number”.
Answered by adventureisland
40

First, declare the variable for two numbers a & b. If a > b, A is the biggest Print "A is Biggest". else print "B is Biggest".

An algorithm to find the greater number between two numbers​ :

Start creating a variable named biggest to store the largest number, assuming the numbers are entered one after the other.

Change the variable "biggest" to that integer when the very first integer is entered.

Check to determine if the next number is greater than the variable stored in "biggest" because the next integer is entered.

⇒ If the number entered is bigger, the biggest value is equal to the number entered.

⇒ The biggest number will be the one saved in "largest" once the two numbers have been entered.

ALGORITHM :

Step 1: START  

Step 2: Declare variables a, b.  

Step 3: If a > b go to step 4 otherwise go to step 5  

Step 4: If A is the biggest Print "A is Biggest"  

Step 5: else print "B is Biggest"  

Step 6: STOP

Similar questions