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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a function in oop?

1041


What are main features of oop?

1099


What is an example of genetic polymorphism?

1143


What is encapsulation and abstraction? How are they implemented in C++?

1094


What is the problem with multiple inheritance?

1121


Why do we use polymorphism in oops?

1007


What is polymorphism what are the different types of polymorphism?

967


What is destructor example?

1010


Why is static class not inherited?

1066


What does it mean when someone says I oop?

1030


What is the real life example of polymorphism?

1135


write a program to find 2^n+1 ?

2036


Why do we use oops?

976


Can a varargs method be overloaded?

1056


What is the significance of classes in oop?

1095