Swap P65437


Statement
 

pdf   zip   main.cc

html

Write a procedure

void swap2(int& a, int& b);

that swaps the value of its parameters.

Observation You only need to submit the required procedure; your main program will be ignored.

Public test cases
  • Input/Output

    swap2(2, 5) → 5 2
    swap2(0, -3) → -3 0
  • Information
    Author
    Jordi Petit
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++
    User solutions
    C++