------------------------------------------------------------------------------------------------------------
Previous Page Home
------------------------------------------------------------------------------------------------------------
6.
Which type of files can’t be opened using fopen()?
A. .txt
B. .bin
C. .c
D. None of the mentioned
Answer: D
------------------------------------------------------------------------------------------------------------
7.
What does the following segment of code do?
fprintf(fp, “Copying!”);
A. It writes “Copying!” into the file pointed by fp
B. It reads “Copying!” from the file and prints on display
C. It writes as well as reads “Copying!” to and from the file and prints it
D. None of the mentioned
Answer: A
-----------------------------------------------------------------------------------------------------------
8.
Which of the following fopen statements are illegal?
A. fp = fopen(“abc.txt”, “r”);
B. fp = fopen(“/home/user1/abc.txt”, “w”);
C. fp = fopen(“abc”, “w”);
D. None of the mentioned.
Answer: D
-----------------------------------------------------------------------------------------------------
9.
When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?
A. Standard input
B. Standard output
C. Standard error
D. All of the mentioned
Answer: D
----------------------------------------------------------------------------------------------------
Previous Page Home
----------------------------------------------------------------------------------------------------
More Imp Topics:
Operators
Pointers
Array
Preprocessor
Structures
Control Structures
Switch Case
Printf
Variables
Previous Page Home
------------------------------------------------------------------------------------------------------------
6.
Which type of files can’t be opened using fopen()?
A. .txt
B. .bin
C. .c
D. None of the mentioned
Answer: D
------------------------------------------------------------------------------------------------------------
7.
What does the following segment of code do?
fprintf(fp, “Copying!”);
A. It writes “Copying!” into the file pointed by fp
B. It reads “Copying!” from the file and prints on display
C. It writes as well as reads “Copying!” to and from the file and prints it
D. None of the mentioned
Answer: A
-----------------------------------------------------------------------------------------------------------
8.
Which of the following fopen statements are illegal?
A. fp = fopen(“abc.txt”, “r”);
B. fp = fopen(“/home/user1/abc.txt”, “w”);
C. fp = fopen(“abc”, “w”);
D. None of the mentioned.
Answer: D
-----------------------------------------------------------------------------------------------------
9.
When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?
A. Standard input
B. Standard output
C. Standard error
D. All of the mentioned
Answer: D
----------------------------------------------------------------------------------------------------
Previous Page Home
----------------------------------------------------------------------------------------------------
More Imp Topics:
Operators
Pointers
Array
Preprocessor
Structures
Control Structures
Switch Case
Printf
Variables