ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the syntax of swap()?
Correct Answer: A — arr1.swap(arr2);
The correct syntax of swap function is arr1.swap(arr2) i.e. one array calling swap() function with second array as parameter to swap function. Also swap is a function therefore [] operator cannot be used to call swap function.