how to swap all the values without using temporary variable.
tha values r a = 20, x=60 and p=2.

Answer Posted / gurusaran

x=x*a; (x=1200)
a=x/a; (a=60)
x=x/a; (x=20)

p=p*x; (p=40)
x=p/x; (x=2)
p=p/x; (p=20)

Hence final values are a=60,x=2,p=20

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern

1528


what do u mean by tagging

1616


Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fit" instead of the number and for the multiples of five print "Bit". For numbers which are multiples of both three and five print "FitBit".

1953


Plz sent me in .net 2.0 interview Question & answers?

1641


Where do we need Operator overloading?

651






Differevce between arrays and array builders?

1645


I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution

2209


How to use string functions in QTP?give some examples

7115


how can we implement locks in plsql?

1790


Tag for turning an image into a hyperlink is

1835


can we extend a class having only one parameterised constructor.Suggest the process to do it.

2053


design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

16220


what are all the validation we need to perform in data stage?

1944


What binary value will be internally stored for NULL for the type S9(1) COMP 3 in mainframe

1548


Mainly Related to Oracle, DBMS , Oracle Stored Procedures, Functions, Oracle 9i Architecture, Redo logs..., Views,

1861