fairuz

Untitled

May 12th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Simple Library
  2.  
  3. *** mymean.h ***
  4. int mean(int, int);
  5.  
  6. *** mymean.c ***
  7. extern void test(void);
  8.  
  9. int mean(int a, int b){
  10. test();
  11. return (a+b)/2;
  12. }
  13.  
  14. *** main.c ***
  15. #include <stdio.h>
  16. #include "mymean.h"
  17.  
  18.  
  19. int main(int argc, char* argv[]) {
  20.  
  21. int v1, v2, m;
  22. v1 = 6;
  23. v2 = 4;
  24. m = mean(v1, v2);
  25.  
  26. printf("The mean of %d and %d is %d\n", v1, v2, m);
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment