Basic C Programming MCQ

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