Program with random number generation
First of all, the requirements are specific in requiring that you "use functions". I'm pretty sure the intent of that was the exact opposite of how you've structured the code, with everything in main.

You might want to consider some (more or less) top-down style development, where you write a simple main that has practically nothing except calls to lower-level functions. I'd do this by thinking of a short (word or two) summary describing each step in the specification, and use those as function names.

int main(void) { 
    house_t houses[2];

    // 1. put initial population in each house:
    populate(houses[0]);
    populate(houses[1]);

    for (week = 1; week &lt; N; week++) {
        // 2. each week, each house's population increases
        increase_pop(houses[0]);
        increase_pop(houses[1]);

        // 3. each week, a percentage of the population may migrate between the houses
        do_migration(houses[0], houses[1]);

        // 4. every four weeks, an exterminator visits one of the houses
        if (week % 4 == 0)
            exterminate(random_choice(houses, 2));

        // 5. Presumably we want to show the data for each house weekly.
        show(houses[0]);
        show(houses[1]);
    }
}


A few things about that code may be open to question -- for example, the spec doesn't seem to specify how to choose which house is exterminated at any given time. I've used a random_choice, but perhaps you think strict alternation makes more sense. In any case, however, The important point is that what we see here should be about as close as possible to a direct translation of the steps outlined in the requirement into the syntax of the target language. From there, we can define the sub-parts in relative isolation from each other.

Right now, this makes life much easier for your teacher: it's fairly easy to look through main and figure out whether it fits the requirements. He can then glance through each of the functions and see whether that function does what it's supposed to as well.

I'd also note that the same basic idea applies when school is over and you're writing real code. The big difference here is that you will spend a lot of time doing what the teacher is doing now, reading and analyzing code, not just writing it. In school, you tend to write code and (almost) never look at it again. In real life, you live with the code after you've written it.

I suspect that you have the idea of writing the code and getting it working, then breaking it up into functions. I'd advise against that. It makes the job considerably more difficult.

I'd also note how this changes the situation if (for example) you need/want to change the parameters. For example, assume you have 5 (or 50) houses in a row, and wanted to run the situation for a year instead of 10 weeks. With the code as I've written it above, that would mostly mean rewriting most of the code that explicitly refers to houses[0] or houses[1] to instead use loops and refer to houses[i]. Don't try to go overboard with this idea though. If you can make the code more flexible like this without adding extra complexity, great. At the same time, don't spend (much) extra time or work writing against possible changes in requirements that may never happen.