Error Handling


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    FILE *fp = stdout;
    stderr = fp;
    fprintf(stderr, "%s", "Interveiw Mania");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Interveiw Mania


  1. What happens when we use the following C statement?
    fprintf(stderr, "error: could not open file");











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The diagnostic output is directly displayed in the output



  1. stderr is similar to?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    stdin


  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    char buff[25];
    stderr = stdin;
    fscanf(stderr, "%s", buff);
    printf("%s\n", buff);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Whatever user types



  1. Within main, return expr statement is equivalent to ________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    exit(expr)