C++ char type control for loop

Description

C++ char type control for loop

#include <iostream>
using namespace std;
int main()//from w  ww .j  a v  a2  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;
}



PreviousNext

Related