Code:
#include <stdio.h>
#include <string.h>
void sentenceGenerator( char article1[], char noun1[], char verb[],
char preposition[], char article[], char noun[] );
int main()
{
const char *article1[5]= { "the", "a", "one", "some", "any", };
const char *noun1[5]= { "boy", "girl", "dog", "town", "car", };
const char *article[5]= { "the", "a", "one", "some", "any", };
const char *noun[5]= { "boy", "girl", "dog", "town", "car", };
const char *verb[5]= { "drove","jumped", "ran", "walked", "skipped", };
const char *preposition[5]={ "to", "from", "over", "under", "on", };
int i;
srand( time( 0 ) );
void sentenceGenerator( article, noun, verb, preposition, artical, noun )
}
}
void sentenceGenerator( char article[], char noun[], char verb[],
char preposition[], char article[], char noun[] )
{
int i;
for (i = 0; i <20; i++)
{
printf( "%s%s%s%s%s%s\n", article1, noun1, verb, preposition, article, noun );
}
}