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

swapping program does not use third variable

Answer Posted / venkanna

swap(a,b);
{
a=a+b;
b=a-b;
a=a-b;
}
Explenation:
if a=5 and b=10
a=a+b(5+10)=15
b=a-b(15-10)=5------------swaped here
a=a-b(15-5)=10------------

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is oop better than procedural?

1032


What is debug class?what is trace class? What differences are between them? With examples.

2186


How is polymorphism achieved?

1053


officer say me - i am offered to a smoking , then what can you say

2094


What is object in oop with example?

1225


What is the types of inheritance?

1091


How can you overcome the diamond problem in inheritance?

1176


What is an example of genetic polymorphism?

1175


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

2189


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4923


What are constructors in oop?

1165


What is a superclass in oop?

1169


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

2125


What is oops in simple words?

1083


What is oops concept with example?

1011