Here I'm trying to write the C code, but I've stuck in the error,
#include <stdio.h>
int main(void)
{
int width = 0;
while (! (width >= 1) || ! (width <= 8))
{
printf("Enter the width of the Pyramid: ");
scanf("%i", &width);
}
printf("%i\n", width);
for (int i=0; i<=width; i++)
{
int k = width - (i+1);
for (int j=0; j<=width; j++)
{
if (j == k)
printf("#");
k++;
else
printf(" ");
}
printf("\n");
}
}
Error message
**misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
printf("#");
^
mario.c:21:13: note: previous statement is here
if (j==k)
^
mario.c:25:13: error: expected expression
else
^
2 errors generated.**