You are viewing a single comment's thread. Return to all comments →
//hope this will help you
using namespace std;
void update(int *a, int *b){ *a = *a + *b; cout << *a << endl; *a = *a - *b; *b = abs(*a - *b); cout << *b << endl; }
int main() { int a, b; int *x = &a; int *y = &b; scanf ("%d\n %d", &a, &b); (update(x, y)); return 0; }
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 →
//hope this will help you
include
include
include
include
include
using namespace std;
void update(int *a, int *b){ *a = *a + *b; cout << *a << endl; *a = *a - *b; *b = abs(*a - *b); cout << *b << endl; }
int main() { int a, b; int *x = &a; int *y = &b; scanf ("%d\n %d", &a, &b); (update(x, y)); return 0; }