C++ examples for Statement:for
For loop combines all three of these steps together into a single statement.
#include <iostream> int main() /* w w w . j av a 2 s . c o m*/ { int number; std::cout << "Enter a number: "; std::cin >> number; std::cout << "\nFirst 10 Multiples of " << number << "\n"; for (int counter = 1; counter < 11; counter++) { std::cout << number * counter << " "; } std::cout << "\n"; return 0; }