How to swap two values without using the third variable in java?

4.56K viewsJava
0

Please write a snippet code (logic) for how to swap two values without using the third variable?

Manohar Answered question July 8, 2019
Add a Comment
0

Try this logic..

int f = 10;
int s = 5;

f = f * s;
s = f / s;
f = x / s;

Manohar Changed status to publish July 8, 2019
Add a Comment
You are viewing 1 out of 2 answers, click here to view all answers.
Write your answer.