Skip to content

Instantly share code, notes, and snippets.

@dd1994
Created April 29, 2014 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dd1994/11395963 to your computer and use it in GitHub Desktop.
Save dd1994/11395963 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void sumDiff(int , int , int *, int *);
int main(void)
{
int a, b, sum, diff;
while(scanf("%d %d", &a, &b) != EOF)
{
sumDiff(a, b, &sum, &diff);
printf("sum=%d diff=%d\n", sum, diff);
}
return 0;
}
void sumDiff(int op1, int op2, int *pSum, int *pDiff)
{
*pSum = op1 + op2;
*pDiff = op1 - op2;
}
@dd1994
Copy link
Author

dd1994 commented Apr 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment