why does it print nothing and exit when stdin gets -1?
#include <stdio.h>

int main() {
    char phone[11];
    int integer;
    scanf("%s", phone);
    scanf("%d", &integer);

    while (integer != EOF) {    
        if (integer == -1) {
            for (int i = 0; i < 10; i++) {
                printf("%c", phone[i]);
            }    
            printf("\n");
        }

        else if (integer > -1 && integer < 10) {
            printf("%c\n", phone[integer]);
        }

        else {
            printf("ERROR\n");
            return 1;
        }
        
        scanf("%d", &integer);
    }
    
    return 0;
}
