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
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
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
144. The contents of a file will be lost if it is opened in
- a mode
- w mode
- w+ mode
- a+ mode
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.
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.
147. sex can be accessed by
- criminal. sex
- kd ---> sex
- (*kd). sex
- either (a) or (c), but not by (b)
148. pincode can be accessed by
- criminal . locate. pincode
- criminal. pincode
- kd ---> locate. pincode
- kd.locate ---> pincode
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)
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)