How to swap values between two variables without using a
third variable?
Answer Posted / neha
class SwapBitwise
{
public void SwapByBitwise(int x, int y)
{
x =x ^ y;
y = x ^ y;
x = x ^ y;
System.out.println("x : " + x + " " + "y :" + y);
}
}
public class SwapOperation
{
public static void main(String[] args) {
SwapBitwise obj = new SwapBitwise();
obj.SwapByBitwise(200, 300);
}
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
WHAT IS THE MEANING OF CONSTANT ...EXEEDS LENGTH LIMIT WHILE COPYING FROM PS FILE TO KSDS
3. What is the difference between testing and Quality Assurance?
Outline the two important features of a terminating recursion. Any ideas?
Can we write a method in JSP.If so how?
how can i create report in abap to insert data in table pa0002 using insert command
what is delimiter in sas ?
What are the Short cut Keys of Tally ERP?
What is the meaning of client-server application. The purpose of Client-Server Application. with description.
Given an array of size n+1 which contains all the numbers from 1 to n.Find the number which is repeated in O(n) time.How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
hi viewers, tell me,what is scripting and programming, define and difference...pls
In an customer exit (include Z) program, only the last record is getting fetched. The exit is getting called after pressing save button. What to write for fetching the first record ? Before saved to a SAP table how can i call all these records in an itab in the exit ?
which book we learned this mantis? how many version are realsed this mantis upto now?
how to check single or double byte in struts
public static void main(String args[]) describe it
I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com