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

Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.

13 Answers   IBM,


what is a class

6 Answers  


char* ptr = "Rahul"; *ptr++; printf("%s",ptr); What will be the output

9 Answers   Persistent,


what is cast operator?

2 Answers   Microsoft,


Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?

2 Answers  


What does it mean when someone says I oop?

0 Answers  


What is and I oop mean?

0 Answers  


can inline function declare in private part of class?

1 Answers  


Why is destructor used?

0 Answers  


how much classes are used in c++

5 Answers  


Can we have a private virtual method ?

8 Answers   Ness Technologies,


design class for linked list and include constructor,destructor,insert option. node of form struct node { int data; struct node &ptr; }

0 Answers  


Categories