// For Loop Example #1 C++ Code from CodingMagic.com in Lesson 07: For Loops // Copyright 2008 by Pierre Dufilie IV #include // Include the system() function so we can pause the program #include // Include the printf() function so we can print to the screen int main(void) { // The main function - this is where the program begins running int a; // Declare an instance of an integer variable, a for (a = 0; a < 3; a++) { // Begin definition of for loop that will begin with a = 0, continue executing while a is less than 3, and increment a by 1 after each loop printf("Hello World!\n"); // Use the printf() function to display "Hello World!" } // End curly brace of for loop system("PAUSE"); // Run a system command via system() function to pause execution return 0; // Represents the return value of the program (EXIT_SUCCESS) }