Computer Science, asked by sk0294461, 6 hours ago

To print the greater of two numbers.

Answers

Answered by imadinosaurrawr
0

Answer:

Algorithm to find the greatest of two numbers.

  1. Ask the user to enter two integer values.
  2. Read the two integer values in num1 and num2 (integer variables).
  3. Check if num1 is greater than num2.
  4. If true, then print 'num1' as the greatest number.
  5. If false, then print 'num2' as the greatest number.

Explanation:

Please try your approach on {IDE} first, before moving on to the solution.

Method 2 (Using List)

  • Initialize three number by n1, n2 and n3.
  • Add three numbers into list lst = [n1, n2, n3].
  • Using max() function to find the greatest number max(lst).
  • And finally we will print maximum number.

-

Please mark me as brainliest. :-)

Hope this helps.

Similar questions