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 / divya c

(y!=x)||(x!=y)?x=y,y=x:y=x,x=y;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we perform dml in function?

1050


how to add a new column to an existing table in mysql? : Sql dba

1049


How do I run a script in sql developer?

936


What is the difference between sql and isql*plus?

1073


tell me about various levels of constraint. : Sql dba

1026


How do you update f as m and m as f from the below table testtable?

1834


How do I run pl sql in sql developer?

1099


How do I find duplicates in two columns?

1131


What is a sql instance vs database?

1101


What is before trigger?

988


what is auto increment? : Sql dba

993


How do you delete data from a table?

1010


Explain the the update statement in sql?

1015


What is sql exception?

949


What is the use of double ampersand (&&) in sql queries? Give an example

1122