Editorial For SSEC-Coding Contest
Problem Link:
SSEC0001Author: Pavan Kumar
Difficulty: Easy-Medium
PREREQUISITES: Basic Maths
Problem:
Complete the function void reload (int *x, int *y) accepting two arguments, which will find sum of them, and with absolute difference of them.Sample Input:
45
Sample Output:
91
Solution:
#include<stdio.h> #include<stdlib.h>void reload(int *x, int *y){
int temp = *x;
*x = *x + *y;
*y = abs(temp - *y);
}
int main(){
int x, int y;
int *px=&x, *py=&y;
scanf(ā%d %dā, &x, &y);
reload(px,py);
printf(ā%d\n%dā,x,y);
return 0;
}