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

Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad

1843


Always use scope terminator like End-If with IF, End- Evaluate with Evaluate statement.Can somebody explain me the detail logical explanation?

1542


How can we develop a multi-tier application in Java?

1470


in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?

1645


5.Call by value and Call by reference with program?

1830






what are the 3 forms of a prolog term

2753


Explain what is OOPS and its concepts?

582


Find out the roles which gives access to all tables in SAP? Thanks in advance.

1562


Write a program to find whether a given number is prime or not.

604


how sap is different from other software ?

1662


is it possible to desable particular parameter of the normal orcle report based on some condition ?????? if yes,wht is the function for desabling a parameter...

1573


Hello...has anyone interviewed with Information Management Services(IMS)located in Silver Spring MD??If yes,what can you share about the programming test and the analytical test?

1502


How to connect the .accdb database file of microsoft access to the Visual Basic 6.0 forms?

3695


give idea for creating screen in abap

1640


what is integration testing in real time applications?

1841