Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int square(int* a) {
- return *a *= *a;
- }
- void Swap(int* x, int* y) {
- int temp = *x;
- *x = *y;
- *y = temp;
- }
- void Div(int* a) {
- *a /= 2;
- }
- int main() {
- int a = 10;
- int b = 20;
- Swap(&a, &b);
- cout << a << endl;
- cout << b << endl;
- int c = 30;
- Div(&c);
- cout << c << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment