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

3.02K viewsJava
0

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

Answered question
Add a Comment
0

Try this logic..

int f = 10;
int s = 5;

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

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