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

How do you write a subquery?

1023


What is the difference between the conventional and direct path loads? : aql loader

1392


What is difference between function and trigger?

1044


what is the difference between clustered and non clustered index in sql? : Sql dba

1121


What is example of database?

1051


How do you use join?

937


what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

947


What is Histogram?

1554


Can you select everything, but 1 or 2 fields, without writer's cramp?

979


what is try_catch block in procedure

1738


What is the difference between microsoft sql and mysql?

958


Explain ddl statements in pl/sql?

1007


Why truncate is used in sql?

1003


Is drop table faster than truncate?

985


what is a database transaction? : Sql dba

1169