Programming Examples

Python program to print larger number using swap


Write a python program to print larger number using swap

x=int(input("Enter the first Number : "))
y=int(input("Enter the second Number : "))
if x>y:
    x,y=y,x
print("The Larger Number is : ",y)
print("The smaller Number is : ",x)

Output

Enter the first Number : 45

Enter the second Number : 34

The Larger Number is :  45

The smaller Number is :  34

>>> 

======================== 

Enter the first Number : 33

Enter the second Number : 90

The Larger Number is :  90

The smaller Number is :  33

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad