hey, i wanna ask if i have a list of words let say 'tiger, lion, elephant, zebra, horse, camel, deer, crocodile, rabbit, cat' haw can i generate 5 words out of the list randomly in c programming? for example:
tiger, zebra, cat, deer, horse
or
crocodile, rabbit, camel, zebra, elephant
ect
thank you in advance :D
Edit:
#include <stdio.h>
#include <string.h>
#define SIZE 10
int main ()
{
char arr2[SIZE][20] = { "tiger", "lion", "elephant", "zebra", "horse", "camel", "deer", "crocodile", "rabbit", "cat" };
int x = 0;
srand(time(NULL));
while (x < SIZE - 5)
{
arr2 [x][20] = rand ();
printf ("%s\n", arr2[x]);
x++;
}
system ("pause");
return 0;
}