void swap(int &a, int &b) {
        int temp;
        temp = a;
        a = b;
        b = temp;
      }

      Cpp language logo
      Swap numbers

      Cpp recipes

      The code in the void swap function will swap the contents of variables a and b.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.