int main() {
    char phone[11];
    int i;

    scanf("%s", phone);

    do {
        scanf("%d", &i);

        if (i == -1) {
            printf("%s\n", phone);
        }
        else if (0 <= i && i <= 9) {
            printf("%c\n", phone[i]);
        }
        else {
            printf("ERROR");
            return 1;
        }
    }
    while (i != 1);
    
    return 0;
}
Your task is to write a C program called phone_loop.c. This program will again read from standard input using scanf and take no command-line arguments. Similar to phone.c, this program reads a 10-character string as the first input value but then it repeatedly reads integers until standard input is closed. (Hint: Use a while loop that checks the return value of scanf to accomplish this. Check the man page for scanf to determine the return value when the input stream is closed.)

After each integer the output produced is as before:

if the integer is -1, the full string is printed
if the integer is between 0 and 9, the individual character at that position is printed
if the integer is less than -1 or greater than 9, the message "ERROR" is printed (to stdout)
In each case the printing is followed by a newline character.

When the program finishes running, main returns with a 0 return code if there were no errors and with a 1 return code otherwise.

Note: the program must not print anything other than then the values specified.