728x90 AdSpace

Latest Article



Swap two Number without using temporary variable in C++ Code





Write a ‘void’ function that swaps two numbers but does not use any local variables that are other than the ones declared as formal parameters?

void swap_func(int& num1, int& num2)
{
num2=num1+num2;
num1=num2-num1;
num2=num2-num1;
return;
}

no image
  • Title : Swap two Number without using temporary variable in C++ Code
  • Posted by :
  • Date : 11:40
  • Labels :






  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment