You are viewing a single comment's thread. Return to all comments →
using namespace std; void update( int *a, int *b ); int main() { int a; int b; cin >> a; cin >> b; update(&a, &b); return 0; } void update( int *a, int *b ) { int sum = *a + *b; int sub = *a > *b ? ( *a - *b ) : ( *b - *a ); *a = sum; *b = sub; cout << *a << endl; cout << *b << endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pointer
You are viewing a single comment's thread. Return to all comments →