Wouldn't it be simpler to defer that prefix algorithm to a separate function that returns a boolean?
for (;;) {
printf("Please key in the number of passenger >> ");
if (scanf("%s", &mass_passenger_check) && starts_with(mass_passenger_check, isdigit, 3)) {
break;
}
}
Writing such a function is trivial:
int starts_with(const char *s, int (*pred)(int), int n)
{
while (--n >= 0) {
if (!*s || !pred(*s++)) {
return 0;
}
}
return 1;
}