Advertisement
Guest User

Value Two Value

a guest
Sep 14th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 value(int a); // Function prototype
  14. void two_values(int a, int b);
  15.  
  16. int main() // main function
  17. {
  18. value(6); // Call value function
  19. two_values(25, 55);
  20. }
  21.  
  22. void value(int a) // value function
  23. {
  24. print("The value is: a = %d\n", a); // Display a single value
  25. }
  26.  
  27. void two_values(int a, int b)
  28. {
  29. print("Two values are: ");
  30. print("a = %d, b = %d\n", a, b);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement