Hello i want to add for loop that will print my code for 20 times or 50 times .. but i really can't figure it out since i already add for function but it still give only 1 result :D
#include <bits/stdc++.h>
using namespace std;
const int MAX = 36;
// Returns a string of random alphabets of
// length n.
string printRandomString(int n)
{
char alphabet[MAX] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', '0', '1', '2',
'3', '4', '5', '6', '7', '8', '9'};
string res = "";
for (int i = 0; i < n; i++)
res = res + alphabet[rand() % MAX];
return res;
}
// Driver code
int main()
{
srand(time(NULL));
int n = 20;
cout << printRandomString(n);
return 0;
}