Here is their code, for anyone interested:
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num, x, y;
/* Asks the user to insert a number between 1 - 20 */
printf("Please enter the size of the head: ");
scanf("%d", &num);
/* Checks if the user insert a correct number */
do{
if (num > 20){
printf("Invalid size try again: ");
scanf("%d", &num);
}
else if (num < 6)
{
printf("Invalid size try again: ");
scanf("%d", &num);
}
}while(num < 6 || num > 20);
if(num >= 6 && num <= 20)
{
for (x = 0; x < num ; ++x)
{
for (y = 0; y < num ; ++y)
{
if (x==0 || y==0 || x==(num-1))
{
printf("*");
}
else if (y==(num-1))
{
printf("*\n");
}
else
{
printf(" ");
}
}
}
}
return 0;
}