Examveda

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("newfile", "w");
    printf("%d\n", ferror(fp));
    return 0;
}

A. Compilation error

B. 0

C. 1

D. Any nonzero value

Answer: Option B


This Question Belongs to C Program >> File Input Output

Join The Discussion

Related Questions on File Input Output