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 the variables without using temp and operators



how to swap the variables without using temp and operators..

Answer / santhosh

int a, b;
a = 10;
b = 20;
a = a + b;
//a=30
b = a - b;
a = a - b;

Console.WriteLine("a={0},b={1}", a, b);
Console.ReadLine();

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is oops and why we use oops?

0 Answers  


What is a scope resolution operator?

5 Answers   HP, IBS,


IN PROGRAMING LANGAUGE A C++ IS PURELY OBJECT ORIENTED OR NOT?

2 Answers  


Describe what an Interface is and how it?s different from a Class.

7 Answers   Spinsys,


What is the renewal class?

0 Answers   Ebix, IBM,


can main method be overloaded...??? How..????

2 Answers   Satyam,


143.what is oops principles?

10 Answers  


What is a superclass in oop?

0 Answers  


what is polymorphism?

4 Answers  


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

0 Answers   SRA,


why constructor cannt be declar virtually? why destructor cannt be overloaded?

2 Answers   Infosys,


what is object slicing

3 Answers   TCS,


Categories