Advertisement
Aminpro

[ECP 1016]Tutorial 6 & 7 Question 1C

Aug 2nd, 2012
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. #include <stdio.h>
  4.  
  5. int sum (int x, int y);
  6. int diff (int x, int y);
  7.  
  8. int main(){
  9.    
  10.     int x, y;
  11.     printf("Please enter two intergers: ");
  12.     scanf("%d %d", &x, &y);
  13.    
  14.     printf("%d\n", sum(x,y));
  15.     printf("%d\n", diff(x,y));
  16.    
  17.     getchar();
  18.     getchar();
  19.     getchar;
  20.     return 0;
  21.    
  22.     }
  23.  
  24.  
  25. int sum (int x,int y){
  26.     int sum;
  27.     sum = x+y;
  28.     return sum;
  29.     }
  30.  
  31. int diff (int x, int y){
  32.     int sum;
  33.     sum = x-y;
  34.     return sum;
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement