You are viewing a single comment's thread. Return to all comments →
#include <stdio.h> #include <stdlib.h> int update(int *a, int *b) { int temp_a = *a, temp_b = *b; *a = temp_a + temp_b; *b = abs(temp_a - temp_b); } int main() { int frst, scnd; int *p_frst = &frst, *p_scnd = &scnd; scanf("%d %d", &frst, &scnd); update(p_frst, p_scnd); printf("%d\n%d\n", frst, scnd); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pointers in C
You are viewing a single comment's thread. Return to all comments →
Pointer in C.
Here is an Easy Solution of the problem :