Random Sentences generator This program use random number generator to create sentences. It prints 20 sentences randomly.
Here is the code:

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;time.h&gt;
#include &lt;ctype.h&gt;

#define STR_LEN 80
#define MAX_SEN 20

int main(void) {
    char *article[] = {"the", "a", "one", "some", "any"};
    char *noun[] = {"boy", "girl", "dog", "town", "car"};
    char *verb[] = {"drove", "jumped", "ran", "walked", "skipped"};
    char *preposition[] = {"to", "from", "over", "under", "on"};
    int num;
    char sentence[MAX_SEN][STR_LEN];
    char (*i)[STR_LEN];
    srand((unsigned) time(NULL));
    for(i = sentence; i &lt; sentence + MAX_SEN; i++) {
        num = rand() % (sizeof(article)/sizeof(article[0]));
        strcpy(*i, article[num]);
        num = rand() % (sizeof(noun)/sizeof(noun[0]));
        strcat(strcat(*i, " "), noun[num]);
        num = rand() % (sizeof(preposition)/sizeof(preposition[0]));
        strcat(strcat(*i, " "), preposition[num]);
        printf("%s.\n", *i);

    }

    return 0;
}


Can you make some improvements on the code especially on the sizeof operator. You can use any things functions, arrays, strings, pointers etc. 
Also, I don't know how to make first letter capital of each sentence using toupper() function.
Sorry for no explanation. Not really sure why I wrote this. Just saw your post, got in the zone, and suddenly I have a chunk of code! Hope it is insightful.

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;ctype.h&gt;

const int SEN_LEN = 80;
const int MAX_SEN = 20;

const char* ARTICLES[] = {"the", "a", "one", "some", "any"};
const char* NOUNS[] =  {"boy", "girl", "dog", "town", "car"};
const char* VERBS[] =  {"drove", "jumped", "ran", "walked", "skipped"};
const char* PREPOSITIONS[] =  {"to", "from", "over", "under", "on"};
const int ARTICLES_SIZE = sizeof(ARTICLES)/sizeof(ARTICLES[0]);
const int NOUNS_SIZE = sizeof(NOUNS)/sizeof(NOUNS[0]);
const int VERBS_SIZE = sizeof(VERBS)/sizeof(VERBS[0]);
const int PREPOSITIONS_SIZE = sizeof(PREPOSITIONS)/sizeof(PREPOSITIONS[0]);

char* generateSentence() {
  char* sentence = calloc((SEN_LEN+1), sizeof(char));

  //Build Sentence
  strcat(sentence, ARTICLES[rand()%ARTICLES_SIZE]);

  strcat(sentence, " ");
  strcat(sentence, NOUNS[rand()%NOUNS_SIZE]);

  strcat(sentence, " ");
  strcat(sentence, VERBS[rand()%VERBS_SIZE]);

  strcat(sentence, " ");
  strcat(sentence, PREPOSITIONS[rand()%PREPOSITIONS_SIZE]);

  //Capitalize first letter
  sentence[0] = toupper(sentence[0]);

  return sentence;
}

int main(int argc, char* argv[]) {
    srand(time(NULL));

    for(int i = 0; i &lt; MAX_SEN; i++) {
        char* sentence = generateSentence();
        printf("%s.\n", sentence);
        free(sentence);
    }

    return 0;
}


Requires C99. (-std=c99 on gcc)