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 the advantage in software? what is the difference between the software developer and Engineer

1 Answers  


Is html an oop?

0 Answers  


What is the correct syntax for inheritance? 1) class aclass : public superclass 2) class aclass inherit superclass 3) class aclass <-superclass

6 Answers   Wipro,


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

2 Answers  


what is the function of 'this' operator ?

7 Answers   Wipro,


program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number

1 Answers   Anna University,


What is the purpose of enum?

0 Answers  


What is the real time example of encapsulation?

0 Answers  


difference between class and object

10 Answers   Chandan, IBM, Magic Soft,


How many types of access specifier in c# and vb.net?

1 Answers   Infosys,


Which is the only operator in C++ which can be overloaded but NOT inherited?

8 Answers  


what is overloading and overriding?

7 Answers  


Categories