Infosys Interview Question
295 Interview Reviews |
Back to all Infosys Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Senior Software Engineer at Infosys:
switch value of variables a and b, without using 3rd variable.
See more for this Infosys Senior Software Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?
0 of 0 people found this helpful
by Kitu:
System.out.println("Before Swapping "+var1+", "+var2);
var1 = var1 + var2;
var2 = var1 - var2;
var1 = var1 - var2;
System.out.println("After Swapping "+var1+", "+var2);