Basic C Programming MCQ Questions and Answers

Practice Mode
Showing 10 of 198 questions
Q141
If a file is opened in w+ mode then
  • A appending is possible
  • B reading is possible
  • C writing is possible
  • D after write operation reading is possible without closing and re-opening
Answer: Option
Q142
The fseek function
  • A needs 2 argumentsd
  • B makes the rewind function unnecessary
  • C is meant for checking whether a given file exists or not
  • D needs 3 arguments
Answer: Option
Q143
The statement fseek (fp, 0L, 0); - if syntactically correct, means
  • A fp is a file pointer
  • B position the read-write-head at the start of the file
  • C position the read-write-head at the end of the file
  • D erase the contents of the file
Answer: Option
Q144
The contents of a file will be lost if it is opened in
  • A a mode
  • B w mode
  • C w+ mode
  • D a+ mode
Answer: Option
Q145
Which of the following comments about union are true?
  • A Union is a structure whose members share the same storage area
  • B the compiler will keep track of what type of information is currently stored.
  • C Only one of the members of union can be assigned a value at a particular time.
  • D Size allocated for union jis the size of its member needing the maximum storage.
Answer: Option
Q146
Which of the following comments about the usage of structure is true?
  • A Storage class can be assigned to an individual member.
  • B Individual members can be initialized within a structure type declaration.
  • C the scope of a member name is confined to the particular structure, within which it is defined.
  • D None of the above.
Answer: Option C
Q147
sex can be accessed by
  • A criminal. sex
  • B kd ---> sex
  • C (*kd). sex
  • D either (a) or (c), but not by (b)
Answer: Option
Q148
pincode can be accessed by
  • A criminal . locate. pincode
  • B criminal. pincode
  • C kd ---> locate. pincode
  • D kd.locate ---> pincode
Answer: Option
Q149
The third character in the criminal name can be accessed by
  • A criminal.name [2]
  • B kd ----> name [2]
  • C ((*kd . name([2]
  • D either (b) or (c), but not by (a)
Answer: Option
Q150
* (kd ----> name + 2) can be used instead of
  • A * (criminal. name +2)
  • B kd ----> (name + 2)
  • C * ((*kd). name + 2)
  • D either (a) or (b), but not (c)
Answer: Option
Questions and Answers for Competitive Exams Various Entrance Test