What will be the output of the following C code? [code] #include <stdio.h> int main() { FILE *fp; char c;

KellyPoima

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    int main()
    {
        FILE *fp;
        char c;
        int n = 0;
        fp = fopen("newfile1.txt", "r");
        while (!feof(fp))
        {
            c = getc(fp);
            putc(c, stdout);
        }
    }
A. Compilation error
B. Prints to the screen content of newfile1.txt completely
C. Prints to the screen some contents of newfile1.txt
D. None of the mentioned
 

Tìm kiếm

Back
Top