1 char c;
2 int r;
3
4 srand (time(NULL)); // initialize the random number generator
5 for (i=0; i<num; i++)
6 { r = rand() % 26; // generate a random number
7 c = 'a' + r; // Convert to a character from a-z
8 cout << c;
9 }