Input three numbers and display the largest / smallest number.

a=float(input('please enter first number \n'))
b=float(input('please enter second number \n'))
c=float(input('please enter third number \n'))

if(a>=b):
  if(a>=c):
    print('biggest number is ',a)
 else:
    print('biggest number is ',c)
else:
  if(b>=c):
   print('biggest number is ',b)
  else:
   print('biggest number is ',c)

 

Explanation:-In this program we have used complex form of if else decision construct. We have used nested if else decision constructs. Nested means one into another. It depends upon the level of complexity of the logic we are applying.

In first if construct program flow will enter if a>=b, otherwise program flow will enter else decision construct. Both constructs have further if else constructs to confirm biggest number. further exercise nested if else constructs to practice logic.