Leaning C++, It's a very pathetically reincarnated BruteForce =[ It just continues forever, and ignores the cout << ", ";

Thanks for any help,

<3 Jasio

Edit<-- Please don't give me a 5 line code that does the same thing, that's not learning to me. Just help me correct the issue, thanks.

Code:#include <iostream> using namespace std; int main () { int n; int a; int r; cout << "how many attempts "; cin >> n; cout << "how many letters "; cin >> a; do { do { r = (rand()%26); if (r == 0) cout << "a"; if (r == 1) cout << "b"; if (r == 2) cout << "c"; if (r == 3) cout << "d"; if (r == 4) cout << "e"; if (r == 5) cout << "f"; if (r == 6) cout << "g"; if (r == 7) cout << "h"; if (r == 8) cout << "i"; if (r == 9) cout << "j"; if (r == 10) cout << "k"; if (r == 11) cout << "l"; if (r == 12) cout << "m"; if (r == 13) cout << "n"; if (r == 14) cout << "o"; if (r == 15) cout << "p"; if (r == 16) cout << "q"; if (r == 17) cout << "r"; if (r == 18) cout << "s"; if (r == 19) cout << "t"; if (r == 20) cout << "u"; if (r == 21) cout << "v"; if (r == 22) cout << "w"; if (r == 23) cout << "x"; if (r == 24) cout << "y"; if (r == 25) cout << "z"; --a; } while (a != 0); cout << ", "; --n; } while (n != 0); }