# VBForums CodeBank > CodeBank - C++ >  Random word generator

## |2eM!x

I know im not good...just trying to help   :wave:  


```
#include <iostream>
#include <string> 
#include <ctime>

using namespace std;

void RndWord(long iLen){
	char ch;
	string mystr;
	char i=0;
		while (i < iLen){
			ch = (rand()%(('Z'-'A'))+'A');
			mystr += ch;
			i++;
		}
		cout << mystr << "\n";
}

int main(void){
	long lenword;
	srand(time(NULL));
			cout << "Word length?\n";
			cin >> lenword;
			 RndWord(lenword);
		return 0;
}
```

----------


## kfcSmitty

Just a note:

you may want to add



```
system("Pause");
```

After 



```
RdnWord(lenword);
```

so you can actually see the output of the word.

----------


## boyyo11

Or put under


```
RndWord(lenword);
```

put


```
cin.get();
cin.get();
```

----------

