Skip to content
 
 

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

EX-01 Swapping-two-values

NAME:PRADEEP V;

YEAR 1ST YEAR

AI&ML

SEC

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:

#Program to swap two values.
#Developed by:PRADEEP V
#RegisterNumber:23013543
a=eval(input())
b=eval(input())
a,b=b,a
print("Swapped values are:",a,b)

output:

swapping of two variables

RESULT:

Thus the swapping of two values are successfully executed..........................................................................................................

About

Swapping two values

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors