2nd Year Computer Science Chapter 14 File Handling in C Notes MCQs Bank

computer 12th notes chapter No 14

1. If programs get input data from data file and also send output into data file. It is  called :

 
 
 
 

2. A stream can be disassociated from a file using operation:

 
 
 
 

3. A file is stored in :

 
 
 
 

4. ___function is used to read a single character from a file at a time :

 
 
 
 

5. An array subscript should be 

 
 
 
 

6. The index of an element is written within :

 
 
 
 

7. Which of the following function is used to write a string to a file : 

 
 
 
 

8. To open a file __________ function is used 

 
 
 
 

9. A stream is associated with a file using and ________operaton 

 
 
 
 

10. To open a file for writing if it already exists

 
 
 
 

11. To mention end of file point a marker______ is used 

 
 
 
 

12. ___ function is used as formatted output file function : 

 
 
 
 

13. To store data for future use it must be stored on _____________ 

 
 
 
 

14. An array index / subscript must be of data type : 

 
 
 
 

15. Which of the following function is used to copy a string to an array of character

 
 
 
 

16. Which of the following mode open only an existing file for both reading and  writing :

 
 
 
 

17. The fopen() function uses parameter.

 
 
 
 

18. A can store text only.

 
 
 
 

19. A text file is a _________ collection of characters 

 
 
 
 

20. Which of the following functions is used to write a string to a file?

 
 
 
 

21. In file handling sequence of characters refers to __________ 

 
 
 
 

22. In___character conversion

 
 
 
 

23. A sequence of characters from input device to computer is called:

 
 
 
 

24. Pointer is a group of contiguous memory location to store data of same data type. Union

 
 
 
 

25. ___ is true about a stream :

 
 
 
 

26. ___assignment statements assigns value to the first element of an array a :

 
 
 
 

27. Which of the following is ca consecutive group of memory locations with the  same name and type :

 
 
 
 

28. fopen() function take _____ parameters 

 
 
 
 

29. There are ___ types of streams

 
 
 
 

30. To write a character on a file ________ function is used 

 
 
 
 

31. Which one is true about pointer type variable 

 
 
 
 

32. A data file a stored in :

 
 
 
 

33. ___ modes can be used to read and write data to and from the data file : 

 
 
 
 

34. ___ represents the new-line marker :

 
 
 
 

35. Which one is not a valid parameter of putc() function 

 
 
 
 

36. A collection of related records is called __________ 

 
 
 
 

37. On successfully closing a file , the fclose( ) returns : 

 
 
 
 

38. Which of the following functions is used to read character from a file?

 
 
 
 

39. Which mode opens only an existing file for both reading and writing?

 
 
 
 

40. The elements of array abc [10] is numbered from : 

 
 
 
 

41. A file can be closed using _________ funciton 

 
 
 
 

42. The data type of file pointer is :

 
 
 
 

43. In text file, data is stored in :

 
 
 
 

44. In binary stream bytes have ______________correspondence

 
 
 
 

45. ___mode can be used to read data from the data file :

 
 
 
 

46. In text stream characters have _________ correspondence 

 
 
 
 

47. A logical interface to a file is called ____________. 

 
 
 
 

48. An array script should be:

 
 
 
 

49. To write a character on a file function takes ________ parameters 

 
 
 
 

50. In file handling sequence of bytes refers to __________ 

 
 
 
 

51. ___function is used to write a string to a file :

 
 
 
 

52. In the absolute path of a file we use_______ 

 
 
 
 

Short Questions

1. Compare binary and text stream.
2. Define a stream.
“3. Define the following file opening modes:
r, W, A, R+, W+, A+”
4. Define the stream?
5. Do you know the type of variable that stores memory address?
6. How is the end of text file indicated?
7. List any three ways to write data in text files.
8. Name different opening modes provided by C language.
9. What are different types of streams?
10. What do you mean by text stream?
11. What is a binary stream?
12. What is a file?
13. What is a string?
14. What is a text stream?
15. What is an array?
16. What is binary stream?
17. What is data file?
18. What is EOF marker?
19. What is fclose() function?
20. What is fopen() function?
21. What is getc() function?
22. What is input stream?
23. What is meant by EOF?
24. What is meant by fgets() function?
25. What is Newline marker?
26. What is output stream?
27. What is pointer?
28. What is putc() function?
29. What is stream?
30. What is text file?
31. What is the file pointer?
32. What is the purpose of fclose() function
33. What is the purpose of fgets() function
34. What is the purpose of fopen() function?
35. What is the purpose of fprintf() function
36. What is the purpose of fscanf() function
37. What is the purpose of putc() function
38. What is the use of file pointer?
39. Which access method can access the data directly?

Long Questions

1. How to read from and write character to a file using C language?
2. What is a stream? Also discuss its different types.
3. What are file markers? Explain the use of BOF, EOF and New Line.
4. How to open a file using c language? Also discuss its different file opening modes.
5. How to close a file in c language?
6. How strings are stored and retrieved in c language.
7. What is fputs() function? Explain with the help of an example.
8. What is fgets() function? Explain with the help of an example.
9. How to read from and write to formatted data in a file using c language?

Leave a Reply

Your email address will not be published. Required fields are marked *