Advertisement
Guest User

Untitled

a guest
Sep 14th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. /*
  2. Function with Parameter.c
  3.  
  4. Version 0.94 for use with SimpleIDE 9.40 and its Simple Libraries
  5.  
  6. Call a function that displays a value passed to it with a parameter.
  7.  
  8. http://learn.parallax.com/propeller-c-functions/function-parameter
  9. */
  10.  
  11. #include "simpletools.h" // Include simpletools
  12.  
  13. void counter(int startVal, int endVal, int incVal); // Function prototype
  14.  
  15. int main() // main function
  16. {
  17. for(int i = startVal; i <= endVal; i = i + incVal)
  18. {
  19. counter(0, 8, 2);
  20. }
  21. }
  22.  
  23. void counter(int startVal, int endVal, int incVal) // value function
  24. {
  25. print("StartVal = %d\n", startVal); // Display a single value
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement