swap 2 variables without using 3 rd variable???

Answer Posted / gm

Before Swaping
A = 10
B = 20
After Swapping
A = 20
B = 10

Solution:
B = B - A =(20-10) = 10 ---> B = 10
A = A + B =(10+10) = 20 ---> A = 20 (since B = 10 now)

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If automating - what is your process for determining what to automate and in what order

1535


What are the two main categories of software testing?

692


what are the various techniques you will use as soon as the srs was given to you to speedup the testing?

1545


qtp9.2 and qtp10.0 difference

3039


Write the 10 high test cases for making video call/face time?? Write the test cases for credit card accessing the money transfer?? Write the test cases for file transfer from one user to other from Google Drive/drop box?

3649






Encapsulation of attributes and operations inside objects makes it easy to obtain object state information during testing. is it true.explain

1649


give me a example of writing a test case,take any good example which i can understand easily.

1660


What is difference between web site testing, desktop application testing and wireless application testing? what is the difference in testing strategy to test them?

1537


What is benchmark testing? hi friends... can anyone suggest the correct answer plz...

3195


What makes a good software qa engineer?

656


How does a coverage tool work?

695


What are joins and subjoins in the data bases what is data driven testing what is verification and validation What is Quality Assurance (QA) and Quality Control (QC) Is Verification is related to QA and Validation is related to QC ? which type of model you follow basically in your project what is a use case How to test a Bike how to test a Lift (Elevator). which configuration Management tool do you use which Bug tracking tool do you use explain Bug life cycle what is Regression testing what is ALPHA testing ans BETA testing What types of testings comes under Non functional testing what is TEST DIRECTOR what is CMM and CMM i whar are Expressions in Winrunner What is a Compile module Is it Necessary to open the tool first or the application first after getting a bug what will you do if you add a new object or a new module for the existing application then how will you test the application which Defect tracking tool do you use what is change management What is smoke Testing what is sanity testing A application is given to you but the requirements and functionalities are missing what will you do to start the testing which testing documents will be received by the client

1928


What is change request, how you use it?

732


Can anyone please answer the below question on Manual Testing: Tell me about atleast 5 bugs you come across in your last testing?

1593


WHAT IS PROTOCAL TESTING..EXPLAIN? L2, L3 PROTOCALS TESTING MEANS WHAT?EXPLAIN BRIEFLY

6298