ourfunc.cpp 604 B

123456789101112131415161718192021222324
  1. // ourfunc.cpp -- defining your own function
  2. #include <iostream>
  3. void simon(int); // function prototype for simon()
  4. int main()
  5. {
  6. using namespace std;
  7. simon(3); // call the simon() function
  8. cout << "Pick an integer: ";
  9. int count;
  10. cin >> count;
  11. simon(count); // call it again
  12. cout << "Done!" << endl;
  13. // cin.get();
  14. // cin.get();
  15. return 0;
  16. }
  17. void simon(int n) // define the simon() function
  18. {
  19. using namespace std;
  20. cout << "Simon says touch your toes " << n << " times." << endl;
  21. } // void functions don't need return statements