C++ examples for Statement:for
Counter-controlled repetition with the for statement.
#include <iostream> int main(int argc, const char *argv[]) { for (int counter = 1; counter <= 10; ++counter) { std::cout << counter << " "; }//from w ww. ja va 2 s .c o m std::cout << std::endl; return 0; }