I don't know how to properly connect user's input part and for-loop(which is incorrect) in this program. I was seeking for how to do this but didn't find anything useful.
Here are my code:
#include <cs50.h>
#include <stdio.h>
int get_propriate_int(string prompt);
int main(void)
{
int i = get_propriate_int("Height: ");
return i;
}
int get_propriate_int(string prompt)
{
int n;
do
{
n = get_int("%s", prompt);
}
while (n < 1 || n > 8);
return n;
}
for (int k = 0; k < i; k++)
{
for (int j = 0; j < i; j++)
{
printf("#");
}
printf("\n");
}