Computer class 12th

Computer Science Class 12 Chapter 14 File Handling in C Test Paper

Q.1: Tick the correct Option.

1. A file is stored in

(a) RAM

(b) ROM

(c) Hard Disk✅

(d) Cache

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

(a) “w”

(b) “W+”

(c) “r+”✅

(d) “a+”

3. An array scripts should be

(a) Int

(b) Float

(c) Double

(d) An✅

4. Which of the following character is used to mark the end of the string?

(a)  /0✅

(b) \10

(c) \a

(d) \n

5. Which of the following functions is used to write character to a file?

(a) Putc()

(b) putc()✅

(c) fputs()

(d) fgets()

Q.2: Give answer to any eight short questions of the following.

1. Compare binary and text stream.

2. What is text file?

3. What is new line marker?

4. How is the end text file indicated?

5. Do you know the type of variable that stores memory address?

6. What is the use of file pointer?

7. What is string?

8. What is meant fgets () function?

9. Which functions are used read and write string to a file?

Q.3: Give answer to any two questions of the following.

 (a) Write a program to merge the contents of two text files?

 (b) How many mods are there for opening a file in C. Discuss characteristics of different file opening   Modes

Related Articles

Back to top button
Enable Notifications OK No thanks