Logo

Programming-Idioms

History of Idiom 2 > diff from v69 to v70

Edit summary for version 70 by coltonriedel:
[Cpp] Change to preincrement

Version 69

2019-09-26, 15:10:08

Version 70

2019-09-26, 15:14:24

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Imports
#include <iostream>
using namespace std;
Imports
#include <iostream>
using namespace std;
Code
for(int i=0;i<10;i++)
  cout << "Hello\n";
Code
for (int i = 0; i < 10; ++i)
  cout << "Hello\n";