We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Introduction
- Pointer
- Discussions
Pointer
Pointer
Sort by
recency
|
1123 Discussions
|
Please Login in order to post a comment
include
include
include
include
include
using namespace std;
void update(int *a, int *b){ int sum , diff; sum = *a+*b; diff = abs(*a-*b); *a=sum; *b=diff; }
int main() { int a ,b; int *pa = &a; int *pb = &b; cin>>a>>b; update(pa, pb); cout<
void update(int *a,int *b){ int p,q; p = *a; q = *b; *a = p+q; *b =p-q;
} int main() {
}
`
void update(int *a,int *b) { // Complete this function int hello= *a;
*a= *a + *b; if (hello < *b) { *b= *b - hello; } else{ *b= hello - *b; } }