Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int walk(int w1, int w2);
  4. int swim(int s);
  5. int fly(int f);
  6.  
  7. int main(void)
  8. {
  9. int ma = 4, mb = 30, mc = 2000;
  10. mc += walk(ma + 6, mb + 7);
  11. printf("mc has a value of %d\n", mc);
  12. return 0;
  13. }
  14.  
  15. int walk(int w1, int w2)
  16. {
  17. int a, b;
  18. b = swim(w2);
  19. a = fly(w1);
  20. return -b + a;
  21. }
  22.  
  23. int swim(int s)
  24. {
  25. int c;
  26. c = s % 8;
  27.  
  28. // point one
  29. return c;
  30. }
  31.  
  32. int fly(int f)
  33. {
  34. int d;
  35. d = f * 12;
  36.  
  37. // point two
  38.  
  39. return d;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement