Your browser does not support JavaScript!'

File Handling In C Language Solved MCQs ~ CSBoxer

Welcome to CSBoxer, as you guys know. CSBoxer is all Computer Science's fundamentals.
All published articles are organized in simple, easy, and short English sentences to familiarize the students with computer science.
In that respect today's article is File Handling In C Language Solved MCQs


Today's Topic
File Handling In C Language Solved MCQs


Q1) A binary stream is a sequence of:

  1. Bits
  2. Bytes
  3. Kilobyt
  4. Gigabytes

Answer:Bytes

Explanation:Bytes

Q2) The character conversion may occur in:

  1. Output stream
  2. Input stream
  3. Binary stream
  4. Text stream

Answer: Input stream

Explanation: Input stream

Q3) A sequence of characters from an input device of computer is called

  1. Binary stream
  2. Input stream
  3. Text stream
  4. from an existing file

Answer:Input stream

Explanation:Input stream

Q4) In ___ file opening mode, data can only be read:

  1. w
  2. w’
  3. R+
  4. r

Answer:r

Explanation:r

Q5) The fopen () function takes ______ Parameters

  1. 1
  2. 2
  3. 3
  4. 4

Answer:2

Explanation:2

Q6) In the Statement FILE *FP, the * represents to:

  1. Multiplication
  2. Parameter
  3. Pointer
  4. Variable

Answer:Pointer

Explanation: Pointer

Q7) Which memory location contains the address of another memory location?

  1. Function
  2. Program
  3. Variable
  4. pointer

Answer:pointer

Explanation:pointer

Q8) On successful closing a file, the fclose () returns:

  1. Null in 0
  2. zero
  3. One
  4. File pointer

Answer:Zero OR (0)

Explanation:The fclose() function returns 0 if it successfully closes the stream, or EOF if any errors were detected

Q9) Which of the given function is used to write a string to a file?

  1. puts
  2. put c ()
  3. f gets()
  4. fputs ()

Answer:fputs ()

Explanation:The fwrite() function is used to write to a file. The first parameter of fwrite() contains the name of the file to write to and the second parameter is the string to be written.

Q10) Which of the method will close a file?

  1. Close all
  2. Close
  3. Append
  4. Exit

Answer:Close

Explanation:n C, a file is closed using the fclose() function. This returns 0 on success and EOF in the case of a failure.

Q11) A file is stored in: (

  1. RAM
  2. Hard disk
  3. Cache
  4. ROM

Answer:Hard disk

Explanation:A hard disk drive (HDD), hard disk, hard drive, or fixed disk, is an electro-mechanical data storage device that stores and retrieves digital data

Q12) A ________ can store text only:

  1. Binary File
  2. exe File
  3. Object File
  4. Text File

Answer:Text File

Explanation:A text file (sometimes spelled textfile; an old alternative name is flatfile) is a kind of computer file that is structured as a sequence of lines of electronic text.

Q13) In text file data is stored in:

  1. ASCll-code
  2. Binary code
  3. Octal-code
  4. Text code

Answer:Text code

Explanation:Text code only

Q14) Which of the following function is used to write a character to a file?

  1. getc ( )
  2. putc ()
  3. fputs ( )
  4. fgets ()

Answer:putc ()

Explanation:The putc() function converts c to unsigned char and then writes c to the output stream at the current position.

Q15) An array subscript should be:

  1. int
  2. float
  3. double
  4. real

Answer:int

Explanation:Array subscripts are treated as signed 32-bit integers.

Q16) Which of the following functions is used to copy a string to an array of characters:

  1. strcpy
  2. strpey
  3. stryep
  4. copy

Answer:strcpy

Explanation:The strcpy() function copies string2, including the ending null character, to the location that is specified by string1.

Q17) Which of the following character is used to mark the end of the string?

  1. \r
  2. \c
  3. \o
  4. /o

Answer:\o

Explanation:The escape sequence \o is a commonly used octal escape sequence, which denotes the null character, with value zero.

Q18) Which of the following function is used to read date from a file?

  1. fputc
  2. fputs
  3. fprintf()
  4. fscanf()

Answer:fscanf()

Explanation:The fscanf() function reads data from the current position of the specified stream into the locations that are given by the entries in argument-list, if any.

Post a Comment

0 Comments

^