peaceofpi posted a solution using just an if() statement that you could use. However the for statement is a simple concept and
VERY helpful.
to begin with we state we want a for loop, for().
Then we set a variable up used for counting, int i = 0; note i is normally used just by default. then we specify the condition that must be met, i < 2; (i must be less than 2) if the condition is met then we continue to loop, and finally i++, is how we modify i. Each time the loop iterates through i++ is called.
Explained here.
Chris