It depends how complicated you want it to be.
The simple way is to have two nested for loops. The inner loop goes from 1 to x, printing an asterisk at a time. When the loop completes, output a newline (\n) to go to the next line. Then the outer loop goes from 1 to y, so it is printing one row at a time.
The use of void sounds like the point is that the function can be declared as void because it doesn't have to return anything.
If you want to be more complicated, you could create a string by malloc'ing x + 2 bytes. Put asterisk in the first x bytes, \n in the next one, and then null in the last, to terminate the string. Then you can printf the entire string to print the first line. Put that in a loop that goes from 1 to y.