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 / sushma rani

Here we have two variable A=4, B=3

we need to swap values without taking any third variable
result should be A=3, B=4

for that we can do ,
A=A+B-A (e.g. A=4+3-4 => 3)
and
B=B+A-B (e.g. B=3+4-3 => 4)

That's it....

Thanks & Regards
Sushma Rani
Bangalore
===========

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Code for display the images from drive using vb 6.0?

5334


Differevce between arrays and array builders?

2191


MOV.CB 007H,ADCON1 MOVE.CT 001H,_OPTION_REG_7 MOV.CB 007H,CMCON

2098


Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches

2048


how many types of operating system are avaliable?

2406


What is the use of Differ interface check box in Ship confirm?

2442


hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com

2037


how to convert hashmap to arraylist with iteration

2065


8.In DSP,Define Signal and System?and various type of signals.

2085


Diffrence between 2.0,3.0,3.5,4.0. versions of .net?

3203


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.

1291


design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

17925


Write a program to find whether a given number is prime or not.

1085


Do not use more than 3 nested IF. Use Evaluate statement in case of more IF required. Please give a detail explantion besides readability and clarity for Evaluate stmt.

2034


we create a pf with 3 fields.2 is defined as keyfields.we lock it with alcobj command.how we find out whether the file is locked or not?is it dspfd??/

2091