djmattyg007

MattFunctions

May 22nd, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. //START HEADER
  2.  
  3. #ifndef MATTFUNCTIONS
  4. #define MATTFUNCTIONS
  5. void println(const char* format, ...);
  6. int isEven(int n);
  7. int isOdd(int n);
  8. #endif
  9.  
  10. //END HEADER
  11.  
  12. //START SOURCE FILE
  13.  
  14. #include <stdio.h>
  15. #include <stdarg.h>
  16.  
  17. void println(const char* format, ...)
  18. {
  19.     va_list args;
  20.     va_start(args, format);
  21.     vprintf(format, args);
  22.     va_end(args);
  23.     printf("\n");
  24. }
  25.  
  26. int isEven(int n)
  27. {
  28.     return ((n & 1) == 0);
  29. }
  30.  
  31. int isOdd(int n)
  32. {
  33.     return ((n & 1) == 1);
  34. }
  35.  
  36. //END SOURCE FILE
Advertisement
Add Comment
Please, Sign In to add comment