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 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz