File I/O
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
FILE *fp = stdout;
int m;
fprintf(fp, "%d ", 55);
fflush(stdout);
fprintf(stderr, "%d", 85);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
55 85
- What does the following segment of C code do?
fprintf(fp, "Interview Mania!");
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
It writes “Interview Mania!” into the file pointed by fp
- What is FILE reserved word?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
It is a type name defined in stdio.h
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
FILE *fp = stdin;
int num;
fprintf(fp, "%d", 55);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Nothing
- What will be the output of the following C code?
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp = stdout;
int num;
fprintf(fp, "%d", 102);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
102