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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad