Modify a program that prints all two letter website addresses to include numbers

Hi, I am working on a (non-homework) programming problem. I am given a program that uses "while" loops to create a list of all two letter domain names and am asked to modify it to include numbers in the second digit as well (i.e. instead of stopping at az.com, it needs to include a1.com, a2.com, etc.). The hint I am given suggests that I create a second nested loop after the first one. Um...totally stumped. I am very new to programming and would like to see how more experience programmers would tackle this. Tried everything I could think of and even managed to crash my computer once :-)

Here is a section of the code that contains the pre-existing loops that I am supposed to modify:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

  int main() {
   char usrInput ='?', letter1 = '?', letter2 = '?';

   cout << "\nEnter any key to begin: ";
   cin >> usrInput; // Unused; just to start the printing

   cout << "\nTwo-letter domain names:\n";

   letter1 = 'a';
   while (letter1 <= 'z') {
      letter2 = 'a';
      while (letter2 <= 'z') {
         cout << letter1 << letter2 << ".com\n" ;
         ++letter2;
      }
      ++letter1;
   }


I have found I learn best by seeing things modeled for me, so it would be super helpful to see some ideas of how to solve this problem using loops.
Thanks,
Reuben
Topic archived. No new replies allowed.