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
MOV.CB 007H,ADCON1 MOVE.CT 001H,_OPTION_REG_7 MOV.CB 007H,CMCON
I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...
Write a program to find whether a given number is prime or not.
What is the merger sort principle and its time complexity.
write the a cl program with the following specification A. Accept 2 parameters-date and date type B. if date type is J then convert date to *MDY format C. if date type is M convert date to *JUL format 4.send a program message with the value of converted date Please explain for each with coding?
Difference between views and index in sas programming
hi..this is kartheek..complted mca in 2009..but i dont have knowledge in programing..but to learn new language.. which one is suitable for me?is SAP or IBM mainframes is suitable for me..?if it suits how much will it costs..?pls answer...
Write a shell program to test whether a given year is leap year or not ?
hi i m deepak my shedule for NIC pi is 17 Apr please contact me if anybody has interview on same day or give me some idea who have faced
Tell me the jobs for the MCA Fresher in delhi, Noida..
Write code to read the records from a file and load any array of size 99?make sure that you take care of all the error conditions?
Hi can you please help for the following. I have a ASP.Net web page I want to print the whole page how is it possible? I want It in ASP also.Please send me the solutions dipankar.hazari@gmail.com . Thanks in advance.
qtp 9.2 14 days demo version was expired.I uninstalled how to reinstall this again
Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.
hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern