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 / ramakanth

y=x+y-(x=y)

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we update views in sql?

527


Is a view faster than a stored procedure?

541


What are different clauses used in sql?

579


What version is sql?

547


How can I see all tables in sql?

534






Why is sharding used?

544


What is sqlcontext?

546


What is scope and visibility in PL/SQL?

592


Is primary key clustered index?

513


what are the 'mysql' command line options? : Sql dba

548


Can we use ddl statements in stored procedure?

691


What are the key differences between SQL and PL SQL?

621


what are different types of keys in sql?

602


What is sql integrity?

577


What are the various restrictions imposed on view in terms of dml?

514