I've reached the point where I can create a pyramid but have an extra dot in the last row. Can't seem to remove it . Is there something i'm doing wrong in the nested 'for' function?
#include <stdio.h>
#include <cs50.h>
int get_positive_int(void);
//Print Pyramid #s
int main(void)
{
int n = get_positive_int();
for (int i=0 ; i < n ; i++)
{
for (int j=i; j < n; j++)
{
printf(".");
}
for (int j=n-i; j <= n; j++)
{
printf("#");
}
printf("\n");
}
}
// Prompt for Height as +ve integer between 1 and 8
int get_positive_int(void)
{
int n;
do
{
n = get_int("Height: ");
}
while (n < 1 || n > 8 );
return n;
}