I see, you didn't understand the undefined behaviour of your request as suggested by L B. Can you better expand on what you mean by "squares"? Square boxes, brownie squares, drawing squares or the mathematical application of sqaure ie square root?
The point of a public forum is that other people with a similar problem can find the thread and get help without having to re-ask the same question. Getting help by PM is like shutting out society from getting the same help - it is very rude.
The easiest method is to actually do what the assignment asks and use recursion.
I would suggest a 2D array of booleans where you set them to true if you intend to draw a star there. A pointer to this 2D array should be passed through each call of the recursive function, possibly with the width and height too.
The function would draw a square (in the 2D array) centered at the given X,Y coordinates with the given Size. It would then call itself on X,Y at each of the corners and with a reduced size.
Basically, you are drawing a fractal to a certain number of iterations. This means you will also need a parameter to know how many iterations are left.