Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

WHAT IS THE MEANING OF CONSTANT ...EXEEDS LENGTH LIMIT WHILE COPYING FROM PS FILE TO KSDS

2077


3. What is the difference between testing and Quality Assurance?

2025


Outline the two important features of a terminating recursion. Any ideas?

2226


Can we write a method in JSP.If so how?

2036


how can i create report in abap to insert data in table pa0002 using insert command

2215


what is delimiter in sas ?

2027


What are the Short cut Keys of Tally ERP?

2339


What is the meaning of client-server application. The purpose of Client-Server Application. with description.

2203


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?

1055


hi viewers, tell me,what is scripting and programming, define and difference...pls

1984


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 ?

1981


which book we learned this mantis? how many version are realsed this mantis upto now?

1962


how to check single or double byte in struts

1998


public static void main(String args[]) describe it

2119


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

2046