Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void incrementa (int *valor) {
- (*valor)++;
- }
- void swap (int x, int y) {
- int aux = x;
- x = y;
- y = aux;
- }
- int main (){
- int x = 10;
- int y = 5;
- cout << "X: " << x << endl;
- cout << "Y: " << y << endl;
- swap(x, y);
- cout << "X: " << x << endl;
- cout << "Y: " << y << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment