Answers for "swap function c++"

C++
0

c++ swap function

int main()
{
	int a = 5;
	int b = 10;
  
	swap(a, b);
  
	cout << "a = " << a << endl;
	cout << "b = " << b << endl;
}
Posted by: Guest on May-08-2021
0

what did swap method return in c++

Return Value: The function does not return anything, it swaps the values of the two variables
Posted by: Guest on December-16-2020

Browse Popular Code Answers by Language