Advertisement
Atdiy

Counting up to 200 then down

Aug 11th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include "simpletools.h" // Include simpletools
  2.  
  3. int main() // main function
  4. {
  5. for(int n = 0; n < 200; n += 5) // Count to ten
  6. {
  7. pause(500); // 0.5 s between reps
  8. printf("n = %d\n", n); // Display name & value of n
  9. }
  10. for(int n = 200; n >= 0; n -=10)
  11. {
  12. pause(500);
  13. printf("n = %d\n", n);
  14. }
  15. printf("All done!"); // Display all done
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement