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()
{
char c = 'd';
putchar(c);
}
gcc -otest test.c
./test < myfile
#include <stdio.h>
int main()
{
char c = 'd';
putchar(c);
}A. Compile time error (after first command)
B. d in the myfile file
C. d on the screen
D. Undefined behaviour
Answer: Option C

Join The Discussion