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

Hi All,
I am new to programming and want to know how can i write a
code to take input of 2 numbers from user and swap it
without using a temp variable?

Answer Posted / x

a=a+b;
b=a-b;
a=a-b;

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 oop principles?

1166


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

2204


Is abstract thinking intelligence?

1109


What is the renewal class?

2823


What is class and object in oops?

1213


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

2298


What is a function in oop?

1136


What are the components of marker interface?

1106


Can bst contain duplicates?

1243


What is difference between inheritance and polymorphism?

1072


What is object and example?

1225


What is the diamond problem in inheritance?

1199


What is the point of polymorphism?

1092


Write a c++ program to display pass and fail for three student using static member function

3464


Is data hiding and abstraction same?

1105