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

Is postgresql a server?

577


What is sap sql?

536


Is inner join same as self join?

585


What is embedded sql what are its advantages?

507


What is a dirty read sql?

487






How do I run sql profiler?

588


Why function is used in sql?

524


Are sql connections encrypted?

560


When you have to use a default "rollback to" savepoint of plvlog?

725


How do I clear the screen in sql plus?

553


What is difference between inner join and self join?

595


What is integrity in sql?

562


Is the primary key an index?

597


Which query operators in sql is used for pattern matching?

546


What is pls_integer in pl sql?

541