C++ examples for Statement:for
Prints the alphabet with a simple for loop.
#include <iostream> using namespace std; int main()/*from w w w . j ava 2 s . c o m*/ { char letter; cout << "Here is the alphabet:\n"; for (letter='A'; letter<='Z'; letter++) // Loops A to Z { cout << " " << letter; } return 0; }