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 write test cases for fibonacii series

2 Answers   Impetus,


how do u manage scripts in winrunner when you application is changing frequently?

0 Answers   QA,


What is localization testing?

4 Answers  


What is the bug life cycle? In which part u involved?

2 Answers   AMES Technology, Covansys, Sankhya Infotech,


how to determine if a test environment is approritate?

1 Answers  


What is the example of Integration Testing?

11 Answers   Object Orb, SQL,


How do i write a test condition to test the following simple program with the intention of 100% Condition coverage testing Print “Hello World” If Date $ = ‘01-01-2000’ AND Time $ = “00:00:00” THEN Print “Happy New Year” END IF PRINT “The date is = “Date $ PRINT “The time is = “Time $. Could anyone please clarify in detail. Would really appreciate it....

0 Answers  


would we do functional testing inside integration testing

3 Answers   iGate, iQuest,


Describe any bug you remember. Plz Give some real examples

7 Answers  


Describe a past experience with implementing a test harness in the development of software.

1 Answers  


What is Functional Testing and Regression Testing?give one real time Example?

3 Answers  


What is Cyclometric testing?

0 Answers  


Categories