Python Program to Check Whether a Number is                                                       Even or Odd

Find the Greatest of the two numbers in Python

Given two integer inputs num1 and num2, the objective if to write a code to Find the Greatest of the     

Two Numbers in Python.

Example

Input : num1 = 5 and num2 = 6

Output : 6

Flow Diagram:-

Greatest of two numbers.png

Code:-

  • If num1 == num2

  •        Print both are equal

  • Else if num1 > num2

  •       Print num1 is greater

  • Else, num2 has to be the greater

  •       Print num2 is greater

Algorithm:-

Code:-

num1 = int(input())

num2 = int(input())
if num1>num2:
  print(num1)
else:
  print(num2)

Output:-

Enter a number: 22 10

22 is greater