Is there any possiblty to swap three numbers in a single statement
Eg :
- a = 10
- b = 20
- c = 30
I want values to be changed as per the following list
a = 20
b = 30
c = 10
Can these values be transferred in a single line?
Is there any possiblty to swap three numbers in a single statement
Eg :
I want values to be changed as per the following list
a = 20
b = 30
c = 10
Can these values be transferred in a single line?
I found another solution for this question.
You can use this in many languages like
C,C++ and Java
.It will work for
float
andlong
also.