dhivyapriyar / Swapping-two-values

Swapping two values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swapping-two-values

AIM:

To write a python program for swapping of two values

EQUIPEMENT'S REQUIRED:

PC Anaconda - Python 3.7

ALGORITHM:

Step 1:

Get the two values from the user

Step 2:

Assign the value of second variable to a temporary variable

Step 3:

Assign the value of the first variable to the second variable.

Step 4:

Assign the value in temporary variable to the first variable

Step 5:

Print both the values it would be interchanged

Step 6:

End the program

PROGRAM:

swapping two values
developed by:dhivyapriya.r
register no:22008389

n1=int(input())

n2=int(input())

temp=n2

n2=n1

n1=temp

print("Swapped values are:", n1,n2)

OUTPUT:

swapping.png

RESULT:

Thus the swapping of two values are successfully executed

About

Swapping two values

License:BSD 3-Clause "New" or "Revised" License