I am doing the exercises before the programming exam and I can not do this:
"Write a program that receives a natural number and paint approximately a square figure on a screen using a given drawing pattern, for example, if you read the number 3, the square to be drawn is as follows:
[ "
At the moment I have this:
int patron(int n);
int n;
int main()
{
printf("Introduce el numero natural deseado:\n");
scanf("%d",&n);
patron(n);
}
int patron(int n)
{
int i, j;
for(i=1; i<=n; i++)
{
for (j=1; j<=n; j++)
{
printf("+---");
}
printf("+\n");
}
printf("\n");
return 0;
}
That returns this:
How do I do squares with exclamations? When you add the line breaks, everything breaks down.
Thanks in advance.