0

int main(void)

// Get input of the height

{ int n; do { n = get_int("Height: "); } while ( n < 1 || n > 8 ); } // Print desired pyramid height

for(int i=0 ; i<n; i++); Error message: mario.c 16.4: expected identifier or '('
for this line : for(int i=0; i,n ; i++ );

1 Answer 1

0

I tried your code, it seems to work, at least it's compiled without errors.

#include <stdio.h>
#include <cs50.h>

int main(void)

// Get input of the height
{
    int n;
    do
    {
        n = get_int("Height: ");
    }
    while (n < 1 || n > 8 );

// Print desired pyramid height

for (int i = 0 ; i < n; i++)

}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .