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

1.       If storage class is missing in the array definition, by default it will be taken to be
(A) automatic
(B) external
(C) static
(D) either automatic or external depending on the place of occurrence.
Answer: A
A variable declared inside inside a function without storage class specification is, by default, an automatic variable.
2.       Which of the following is/are advantages of cellular partitioned structure?
(A) Simultaneous read operations can be overlapped
(B) Search time is reduced
(C) Both (A) & (B)
(D) Retrieval time is reduced
Answer: C
3.       The *ptr++ is equivalent to ................
(A) ptr++            (B) *ptr
(C) ++*ptr           (D) none of the above
Answer: D
4.       main()    {
long i = 30000;
printf(“%d”, i); }
the output is
(A) 3000                        (B) 30000
(C) 0                   (D) -1
Answer: B
5.       The directive that can be used to test whether an expression evaluates to a nonzero value or not is
(A) #if                 (B) #elif
(C) #endif          (D) #exit
Answer: A

6.       The maximum number of dimensions an array can have in C is
(A) 3       (B) 4
(C) 5       (D) compiler dependent
Answer: D
C allows arrays of three or more dimensions. The exact limit is determined by the compiler.
7.       Which of the following is not a file operation?
(A) Repositioning        (B) Truncating
(C) Readable                (D) Appending
Answer: C
8.       Which of the following is not a component of file system?
(A) Access method                              (B) Auxiliary storage management
(C) Free integrity mechanism                        (D) None of the above
Answer: D
9.       What is the name of built-in function for finding square roots?
(A) square(x)    (B) sqr(x)
(C) sqrt(x)          (D) No built-in function
Answer: C
sqrt(x) is a built-in function for finding square roots.
10.    A variable that receives an assigned value is called an ................
(A) l value                     (B) r value
(C) value                       (D) assignment
Answer: A

Post a Comment