// For While Loop Example #2 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 a = 0; // Initialize the value of a to zero; while (a < 3) { // Begin definition of while loop that will continue executing while a is less than 3 printf("Hello World!\n"); // Use the printf() function to display "Hello World!" a++; // Increment the value of a by 1 } // End curly brace of while loop system("PAUSE"); // Run a system command via system() function to pause execution return 0; // Represents the return value of the program (EXIT_SUCCESS) }