Can we use the swapping function in one statement?

  
Showing Answers 1 - 5 of 5 Answers

rakesh

  • Jun 12th, 2006
 

yes , we can do it

 void swap(int *a,int *b){a=a+b; b=a-b;a=a-b;}

just call this function as

swap(a,b);

swapping has done

bye..

  Was this answer useful?  Yes

shyamsundar

  • Jul 28th, 2006
 

a=3;a=5;

a=a+b;b=a-b;a=a-b;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions