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

hii I inntrested abt scjp certification but i dont knw abt scjp plz send details abt scjp exam and syllabus.

1633


why we use mantis? what u mean mantis in IT trends? addvantages of mantis?

1981


where is available in this mantis toturials?

1837


I am work in it aompenei

1228


Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.

1763


what is the use MDM(Master Data Management)and meaning

2176


what is the certificates in biztalk?

1665


why we need to take u?

1888


is it acceptable if we declare multiple exceptions in same overridden method.

2369


how many types of operating system are avaliable?

2062


Give examples of macro quoting function?

1757


in a VB application, where the data will be stored after manipulation? what is the syntax for that?

2050


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

1784


Tips for blog integration by www.esteemwebsolutions.com. Can Any body suggest me to how to make wonderful questions on web integration..

1909


Write a program to reverse a number?

885