#include <stdio.h>
#include <cs50.h>
int GetHeight();
int main(void)
{
int a = GetHeight();
for (int i = a; i < 0; i--)
{
for (int j = (i-1); j < 0; j--)
{
printf("%s", " ");
}
for (int k = 0; k < (a-i+2); k++)
{
printf("#");
}
printf("\n");
}
return 0;
}
int GetHeight()
{
int n;
do
{
printf("What is the height of your pyramid: ");
n = GetInt();
}
while (n<1 || n>23);
return n;
}
Hi guys, can anyone help me? I've been stuck with this problem set for some time now and I can't get why this does'nt work. Nothing prints when I run my program other than the reuqest for the height of the pyramind. Appreciate any help. Thanks in advance.