Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. We will do reasonably short assignment this week. As discussed in the class, write the code for the following function. Do NOT do Google search right away and cheat yourself out of learning experience! Since the code is reasonably small, you can copy swap() into Comments box and submit this assignment.
  2. void swap(int &x, int &y) {
  3. //your code!
  4. }
  5.  
  6. main() {
  7. int a = 5, b = 10;
  8. swap(a, b);
  9. cout << a << " " << b << endl;
  10. //it should output 10 5
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement