Computer Science, asked by jkabilesh2902, 4 months ago

Write a Pseudocode for Swapping (Interchanging) of two values without using third variable

Answers

Answered by nevonj2am
0

Answer:

If you want a python program this is what u've been looking for

a=int(input("Enter a number:"))

b=int(input("Enter a number :"))

print("The values of a and b before swapping were:",a,b)

temp=a

a=b

b=temp

print("The values of a  and b after swapping is :",a,b)

Explanation:

temp=a

a=b

b=temp    #u can use the below one instead of this tooo...

a,a=b,b

I hope this works out :)

Similar questions