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...


Swap 2 variables without using a temp variable

Answers were Sorted based on User's Feedback



Swap 2 variables without using a temp variable..

Answer / guest

a,b
a=a+b
b=a-b
a=a-b

Is This Answer Correct ?    21 Yes 0 No

Swap 2 variables without using a temp variable..

Answer / sheetal

if a=5 and b=3 are two variables, then add them i e
a=a+b; a=8
b=a-b; b=5
a=a-b; a=3

Is This Answer Correct ?    12 Yes 0 No

Swap 2 variables without using a temp variable..

Answer / mfsi_satyakamm

int x,y;
x=x+y;
y=x-y;
x=x-y;

Is This Answer Correct ?    12 Yes 1 No

Swap 2 variables without using a temp variable..

Answer / s n

try this one line swaping of two variables


a=((a+b)-(b=a));

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More Manual Testing Interview Questions

How to test the Online Games?? Suggest tricks. I have experience in server-client application testing.

0 Answers  


What is the exact difference between Integration & System testing; give me examples

7 Answers   3i Infotech,


test cases on antivirus with integration testing

2 Answers   Infosys,


What is the difference between web based application and client server application?

2 Answers  


What is Defect Seeding?

3 Answers  


What is the difference between software Product and Project

14 Answers   AppLabs,


Can anyone explain me about Tracebilit metrics?

7 Answers   HCL,


How to write test cases for testing databases,especially for testing and writing test cases for stored procedures.

1 Answers   IBM,


How can u justify u r written all the test cases are meeting the client Requirements?if is there any missing functionality how can u know?

3 Answers   CSC,


can you write test cases on pen?

6 Answers  


What is incremental intergation testing?

2 Answers  


what the diff b/w verification and validation

8 Answers   College School Exams Tests, SunGard,


Categories