Returning to start of loop C

c++loopsreturn

I want to return to the start of the loop and make the user enter another input.

This is what I have but I keep getting the error message repeating over and over again.

How would I return so the user can enter a argument

printf("Enter a option\n");
scanf("%d", &option);

while (option != 1 || option != 2 || option != 3 || option != 4)
{
    if (option == 1)
    {
        option1(...);
        break;
    }
    else if (option == 2)
    {
        option2(...);
        break;
    }
    else if (option == 3)
    {
        option3(...);
        break;
    }
    else if (option == 4)
    {
        option4(...);
        break;
    }
    else
    {
        printf("\nPlease enter a correct option\n");
        continue;
    }
}

Best Solution

Just rearrange the logic, for example like:

do {
printf("Enter a option\n"); 
scanf("%d",&option);

if(option == 1){
    option1(...);
    break;
}

else if(option == 2){
    option2(...);
    break;
}                       

else if(option == 3){
    option3(...);
    break;
}

else if(option == 4){
    option4(...);
    break;
}

else{
    printf("\nPlease enter a correct option\n");
    continue;
}

}
while(true);

Now your code does the scanf only once and then iterates over the same result, instead you must read the value each time you begin the loop.