int addNumbers(int x, int y) { return x + y; }
void increment(int& x) { x++; } int main() { int a = 5; increment(a); cout << a << endl; // Output will be 6 return 0; }
void swap(int &a, int &b) { int temp = a; a = b; b = temp; } int main() { int x = 5, y = 10; swap(x, y); cout << "x = " << x << ", y = " << y << endl; // Output will be x = 10, y = 5 return 0; }In this example, `a` and `b` are input-output parameters. Package library: Standard Library