Thursday, 9 November 2017

File Handling Questions in C

------------------------------------------------------------------------------------------------------------
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




100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...