Home » C Programming » Error Handling » Question
  1. What is the output of the following C code if there is no error in stream fp?
    #include <stdio.h>
    int main()
    {
    FILE *fp;
    fp = fopen("file1", "w");
    printf("%d\n", ferror(fp));
    return 0;
    }
    1. 1
    2. Compilation Error
    3. 0
    4. Garbage value
    5. Any nonzero value
Correct Option: C

0



Your comments will be displayed only after manual approval.