1. ## Generating random letters

im writing a program for practice that writes 1000 random words to an output file. the random words dont have to actual words just a bunch of lower case letters strung together in random lengths of 3 - 9 letters.

im guessing that i would need to generate random numbers 0-25 and then add 65 to correlate them to ascii. I dont know what function to use to generate random numbers between 0 and 25 and i cant really figure out how to add them together in random lengths of 3 - 9 letters.

here is my attempt:

Code:
```void rand_words() {
int     i = 0, j = 0;
int     rand_num = 0;
int     n;
char    word[10];

for( i=0; i<=1000; i++) {
n = random_num_gen(0-25); // not a clue...
n += 65;
// need a line to convert numbers to letters
rand_num = random_num_gen(3-9); // again, no idea what this function needs to be

for( j=0; j<=rand_num; j++) {
word += n;
}

fprintf("%s\n", word)
}

}```

i havent even tried to compile this but im pretty sure i got most of what i need

2. Code:
```for( x = 0; x < numberofwords; x++ )
{
numberofletters = 3 + rand() % 7;
for( y = 0; y < numberofletters; y++ )
{
fputc( 'a' + ( rand( ) % ('z' - 'a') ), here );
}
fputc( '\n', here );
}```
Look at the FAQ on generating random numbers.

Quzah.

3. yeah, that didnt really help. i've looked at the FAQ's but i cant find anything on how to generate random #s between two numbers

4. Originally Posted by ominub
yeah, that didnt really help.
Then you're dumb. I basically did the entire thing for you.
Originally Posted by ominub
i've looked at the FAQ's but i cant find anything on how to generate random #s between two numbers
Then you're an idiot, or you're illiterate. Sheesh, do I have to do EVERYTHING for you?

Now this may be tricky, but that red thing there is a link. You should click on it. Then you should read.

Quzah.

5. well, shucks. thank you o' great one. i didnt ask you to write the program. i asked how to generate random numbers.

6. I showed you how to generate random numbers, and I told you the FAQ covered it as well. It's not my fault you can't read.

Quzah.

7. Originally Posted by ominub
yeah, that didnt really help. i've looked at the FAQ's but i cant find anything on how to generate random #s between two numbers
I think quzah went a bit far, he must be having a bad day to break out the personal attacks. I can certainly agree with his bluntness though in that, in addition to not being able to search the FAQ properly, you have a terrible case of googleblindness. This search was the first thing that popped into my head:
random number between two numbers in C - Google Search
To make it as a programmer, you have to learn to be able to find things out for yourself.