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

Answer Posted / padmas

To swap the values without using temporary variable
for a,x and p,
Do a call to swap function for a and p and
another call to same swap function for x and p.
call1:swap(a,p);
call2:swap(x,p);
swap(variable1,variable2)
{no temporary variable}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does the TCP handle the issue of multiplexing?

2404


what are the missinschema properties and should we pass primary key in select command

1422


when we use mantis? how learn mantis?

1693


THERE ARE 4 SOURCE FILES WHICH CONTAINS SAME METADATA CREATE A TARGET THAT SHOULD DISPLAY THE FILE NAME ALONG WITH THE RECORD PLEASE SEND THE ANSWERFOR THIS QUESTION WITH MAPPING

1683


sample code for data transfer between two r/2 systems and r/3 systems?

1496






write a sql qwery which include joining of two tables 4 marks mainframe

1494


Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1761


What is Negative testing?

1505


Please forward important interview and basic questions in VB6 on my email id: usneha_16@yahoo.co.in

1580


Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.

2085


what are the 3 forms of a prolog term

2757


how to add Servlet-api.jar file into eclipse 3.3.2 ?

4061


where is available in this mantis toturials?

1614


diffrence between oracle apps , .NET , SAP

1607


i am getting the error while compiling my cics program with including db2 dclgen member it is showing that ur dclgen member not including and all the host variables are undeclared

1096