Input & Output


  1. what is the return value of fputs()?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Non-negative if no error & EOF if an error occurs


  1. Which of the following is the right declaration for fgets() inside the library?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    char *fgets(char *line, int maxline, FILE *fp);



  1. Which function has a return type as char pointer?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    fgets


  1. Identify N library function for line input and output in the following C code?
    #include <stdio.h>
    int N(char *str, FILE *iop);
    {
    int ch;
    while (ch = *str++)
    putc(ch, iop);
    return ferror(iop) ? EOF : 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    Compilation Error



  1. What will be the output of the following C function when EOF returns?
    int fputs(char *line, FILE *fp)











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    When an error occurs