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 two numbers with out using temp variable

Answer Posted / pranav

//swaping of 2 numbers without using temp variable
//a=5 & b=6
a=a+b; //a=30
b=a-b; //b=5
a=a-b; //a=6

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a loop? What are different types of loops in c++?

1123


Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---

2102


Do vectors start at 0?

990


What do you mean by ‘void’ return type?

1052


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2539


How to declaring variables in c++?

1155


How does work in c++?

1074


Out of fgets() and gets() which function is safe to use?

1126


what are the iterator and generic algorithms.

1962


Why c++ is not a pure oop language?

1037


Describe public access specifiers?

1111


What is the purpose of the "delete" operator?

1055


What is the iunknown interface?

1123


Why c++ does not have finally?

1074


What type of question are asked in GE code writing test based on c++ data structures and pointers?

3973