PracticeDev/study_cpp/cpp_primer_source_code/Chapter 5/forloop.cpp

14 lines
318 B
C++
Raw Normal View History

2022-12-20 17:31:11 +08:00
// forloop.cpp -- introducing the for loop
#include <iostream>
int main()
{
using namespace std;
int i; // create a counter
// initialize; test ; update
for (i = 0; i < 5; i++)
cout << "C++ knows loops.\n";
cout << "C++ knows when to stop.\n";
// cin.get();
return 0;
}