forloop.cpp 305 B

12345678910111213
  1. // forloop.cpp -- introducing the for loop
  2. #include <iostream>
  3. int main()
  4. {
  5. using namespace std;
  6. int i; // create a counter
  7. // initialize; test ; update
  8. for (i = 0; i < 5; i++)
  9. cout << "C++ knows loops.\n";
  10. cout << "C++ knows when to stop.\n";
  11. // cin.get();
  12. return 0;
  13. }