answersLogoWhite

0

Read 2 numbers. If first is larger than second, display second, else display first.

That's for the smallest. For the largest reverse the two.

For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest.

Best answer

Read 2 numbers. If first is larger than second, display second, else display first.

That's for the smallest. For the largest reverse the two.

For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest.

User Avatar

zakir khan

Lvl 2
3y ago

What else can I help you with?

Related Questions

Design step by steps algorithm on how to write the letter A and display the result?

Design step by steps algorithm on how to write the letter A and display the result


Write an algorithm and draw a corresponding flowchart to search a number in the given list of numbers and also display its position?

please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.


How do you write an algorithm to accept two numbers and divide the first number by second and display their quotent?

To write an algorithm for dividing two numbers, follow these steps: Start by accepting two input numbers, say num1 and num2. Check if num2 is not equal to zero to avoid division by zero errors. If valid, calculate the quotient by dividing num1 by num2 and store the result. Finally, display the quotient. If num2 is zero, display an error message indicating that division by zero is not allowed.


Can you write an algorithm to find the beast numbers?

maybe


How to write an algorithm that accepts five numbers and displays the sum and average of the numbers?

1.Start Algorithm 2.Enter first number 3.Enter second number 4.Enter third number 5.Enter fourth number 6.Enter fifth number 7.Add five number 8.display five number / 2 9.Display result 10.End Algorithm


Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


Write an algorithm or draw a flowchart to display numbers from 100 down to 10?

n=100 loop until n = 9 print n n = n -1 end loop


Write algorithm and draw flowchart to find the sum of even numbers?

jgfujtf


Write an algorithm to print sum of all even numbers?

Start print "the sum of all even numbers is infinite" end


Write an algorithm to calculate the area of a circle and display the result . Use the formulae A=¶r where ¶ is equal to 3.1416?

10001/999900