how to swap to variables without using thrid variable in java?
Answers were Sorted based on User's Feedback
Answer / igor polivanyi
It’s pretty simple:
int a = 12;
int b = 34;
a = a + b;
b = a - b;
a = a - b;
And for real cowboys, it could be simplified further:
a -= (b = (a += b) - b);
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / hemant verma
a=a^b^(b=a);
Hemant Verma
FameofLight@gmail.com
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / mani
int x = 15;
int y = 20;
System.out.println(x+" "+y);
x ^= y;
y ^= x;
x ^= y;
System.out.println(x+" "+y);
| Is This Answer Correct ? | 2 Yes | 1 No |
Get me an image implementation program.
how to write a java program for an output ****0 ***01 **012 *0123 01234
What is coupling in oop?
whats the difference between c and c++
what is ltti
What is abstraction encapsulation?
what is opps?why it is use in programming language?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
How to create a comment page in C #??
explain defference between structure and class with example
what is namespace? what are the uses of namespace?
What makes a language oop?