I want this code to repeatedly get input from the user and iterate until they close the standard input, but it only works for one iteration. How can I make it iterate as described above?
int main(){
    char phone[11];
    printf("Enter in a 10 character string: ");
    scanf("%s", phone);
    int input;
    printf("");
    int value = scanf("%d", &input);
    while (-1 != value) {
        if (input == -1) {
            printf("%s \n", phone);
            return 0;
        } else if ((0 <= input) && (9 >= input)) {
            printf("%c \n", phone[input]);
            return 0;
        } else {
            printf("ERROR \n");
            return 1;
        }
        printf("");
        value = scanf("%d", &input);
    }
}