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...

there are 2 variables called x and y ,x contains 1,2 and y
contains 3,4 we have to swap the values from x to y and y
to x with out using dummy variables and it can be done only
by using a single statement ? how?

Answer Posted / ravin

Buddies, why are you all selecting from and updating the
tables. The question says, just two variables to be swapped
without using any extra variable and also with a single
statement.
And Ramakanth's answer is right i.e. y=x+y-(x=y) . Thats it.

^^x contains 1,2 - didn't understand though.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many triggers are allowed in mysql table? : Sql dba

1102


Why is partition used in sql?

1182


Which one is better sql or oracle?

1013


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

1017


What is the difference between clustered and non-clustered index in sql?

1065


What is pls_integer in pl sql?

1157


Can we debug stored procedure?

1064


What is use of trigger?

986


Can we use the cursor's to create the collection in PL/SQL?

1092


how to create a new view in mysql? : Sql dba

986


What is sql server and ase?

1066


What is sql select statement?

1085


Do foreign keys improve performance?

1068


What sql does db2 use?

1028


What are different types of statements supported by sql?

1209