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

How do you define a class in oop?

1111


What are the three parts of a simple empty class?

2044


What is pure oop?

1091


What is the renewal class?

2746


What is oops concept with example?

1009


Is data hiding and abstraction same?

1002


What is abstract class in oop?

1000


Why do we use polymorphism in oops?

1029


Templates mean

2067


explain sub-type and sub class? atleast u have differ it into 4 points?

2306


How to hide the base class functionality in Inheritance?

1128


Where You Can Use Interface in your Project

1882


What makes a language oop?

1046


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(); }

2587


Why do we need oop?

1180