Okay so the question I was assigned was to create a program where the user enters a number to determine how many rows will be printed.
Ex. User enters 3
Output (it should look like a diamond but the forum keeps making it look like this):
1
121
12321
121
1
This is what I've gotten so far:
Code:
#include <stdio.h>
main(){
int i, j, r;
printf("Enter number of rows (1-9):");
scanf("%d", &r);
for(i=0;i<=r;i++)
{
for(j=1;j<=r;j++)
printf(" ");
}
return 0;
}
What are some things I need to know in order to complete the question? I am really stumped on this one.