I am trying to do a program that produces random limericks and this is what I have so far...
I am posting this again, because I don't think the first one went through. Sorry if it did...
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(){
char *sentence1[]={"There Once was a Man called Reg"};
char *sentence2[]={"Who Went with a Girl in a Hedge"};
char *sentence3[]={"Along came his wife"};
char *sentence4[]={"With a big Carving Knife"};
char *sentence5[]= {"And cut off his meat and two veg"};
char *sentence[] = {","};
int i=0;
for (i=1; i<=20; i++){
strcat (sentence, sentence1[rand()%5]);
strcat (sentence, sentence," ");
strcat (sentence, sentence2[rand()%5]);
strcat (sentence, " ");
strcat (sentence, sentence3[rand()%5]);
strcat (sentence, " ");
strcat (sentence, sentence4[rand()%5]);
strcat (sentence, " ");
strcat (sentence, sentence5[rand()%5]);
strcat (sentence, " ");
printf("%s\n", &sentence[1]);}
return 0;
}