Write a Pseudocode for Swapping (Interchanging) of two values without using third variable
Answers
Answered by
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
Psychology,
2 months ago
Math,
2 months ago
English,
2 months ago
Political Science,
4 months ago
Business Studies,
10 months ago
Political Science,
10 months ago
Geography,
10 months ago