Saturday, 24 October 2015

C & C++ Programming Multiple Choice Questions - Set 9

1.       The keyword ................ is used to declare a generic function.
(A) generic        (B) template
(C) virtual          (D) friend
Answer: B
2.       If an allocation request is not fulfilled ................... exception is thrown.
(A) wrong_alloc           (B) re_alloc
(C) malloc                     (D) bad_alloc
Answer: D
3.       The ............... keyword brings the members of a namespace into view.
(A) view             (B) using
(C) additive       (D) show
Answer: B
4.       ................... determines the type of an object at the runtime.
(A) Static           (B) Dynamic
(C) Typeid         (D) Typedef
Answer: C
5.       The current position of each file pointer using the functions ............... and ...............
(A) pos_type tellg(), pos_type tellp()
(B) pos_type tellx(), pos_type tellf()
(C) pos_type tellx(), pos_type tellp()
(D) pos_type tellf(), pos_type tellp()
Answer: A

6.       The ............... is the function that detects the end of file.
(A) eof()             (B) getline()
(C) putline()      (D) clear()
Answer: A
7.       The elements of an array can be accessed by providing integer expression called ................
(A) superscripts            (B) elements
(C) values                     (D) subscripts
Answer: D
8.       The second element of the array int zones[5]= { 43,54,56,76,78} can be accessed by .................
(A) zones[2]                  (B) zones[1]
(C) zones[3]                  (D) zones[4]
Answer: B
9.       The ............. manipulator skips leading whitespaces.
(A) sw    (B) ws
(C) wt     (D) skipws
Answer: B
10.    The .................. is a short function that gets or sets the value of a private instance variable.
(A) inline           (B) friend
(C) accessor     (D) void
Answer: C


0 comments:

Post a Comment

UGC NET Computer Science

Computer GK App