Q:

break statement doesn't work in a loop

I saw a tutorial that explaining how to use the "break" statement in a loop
but every time i'm trying to use it i'm getting a compilation error saying:

"break statement not within loop or switch
                          break;"

This is my code:
if (finalFirstChar > 6 || finalFirstChar < 1)
{
    printf("You didn't entered a proper number! \n");
    break;
}

A:

FWIW, if is a condition (selection statement, to be exact), and break works in a loop (iteration statement)/switch-case statement.
As per C11, chapter §6.8.6.3

A break statement shall appear only in or as a switch body or loop body.

In any case, you don't need a break in a if statement body.

