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 explain an index number?

529


How to call a javascript function from pl sql?

554


Why cannot I use bind variables in ddl/scl statements in dynamic sql?

658


What are the three pl sql block types?

564


How do I find duplicates in sql?

498






what is a materialized view? : Sql dba

569


Is record in oracle pl sql?

523


explain the difference between delete , truncate and drop commands? : Sql dba

542


Why cross join is used?

622


what are the join types in tsql? : Transact sql

568


How do I save the results of sql query in a file?

529


How can check sql version from command line?

525


What is write ahead logging in sql server?

554


How to look at the current sql*plus system settings?

600


How can you tell the difference between an index and a view?

485