Examveda

What will be the output of the following C code if following commands are used to run (considering myfile exists)?
gcc -otest test.c
./test > myfile

 #include <stdio.h>
int main(int argc, char **argv)
{
    char c = 'd';
    putchar(c);
    printf(" %d\n", argc);
}

A. d 2 in myfile

B. d 1 in myfile

C. d in myfile and 1 in screen

D. d in myfile and 2 in screen

Answer: Option B


This Question Belongs to C Program >> File Input Output

Join The Discussion

Related Questions on File Input Output