0
#include <cs50.h>
#include <stdio.h>
int main(void)
{   
    int n;
    do
    {
        n = get_int("Width: ");
    }
    While (n < 1);


    for (int i = 0; i < 4; i++)
    {
        printf("?");
    }

    printf("\n");
}

enter image description here this is the error what can i do

mario.c:10:5: error: expected 'while' in do/while loop
    While (n < 1);
    ^
mario.c:6:5: note: to match this 'do'
    do

1 Answer 1

2

This is a very, very basic mistake, but something you'll instantly learn not to repeat.

The C language is case sensitive. while is the keyword that should be used, but While is unacceptable. Note the capitalized W.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

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