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

1.       The ............... term refers to the value that is used to call a function.
(A) parameter               (B) argument
(C) variable                   (D) pointer
Answer: B
2.       A ............... is a variable that receives the value.
(A) argument                (B) parameter
(C) variable                   (D) array
Answer: B
3.       The ............... is the variables that contain the address of other variables.
(A) function      (B) string
(C) pointer         (D) identifier
Answer: C
4.       ................. operator returns the address of the identifier.
(A) &                   (B) *
(C) &&                (D) !
Answer: A
5.       The ............... operator is used to return the value of the variable to which the pointer points.
(A) reference                (B) dereference
(C) dot                            (D) arrow
Answer: B

6.       Identify the correct statement regarding scope of variables.
(A) Global variables are declared in a separate file and accessible from any program.
(B) Local variables are declared inside a function and accessible within the function only.
(C) Global variables are declared inside a function and accessible from anywhere in program.
(D) Local variables are declared in the main body of the program and accessible only from functions.
Answer: B
7.       What is the correct value to return to the operating system upon the successful completion of a program?
(A) 2       (B) 1
(C) 0       (D) programs do not return a value
Answer: C
8.       A structure pointer points to an/a .................. of its structure type.
(A) variable       (B) address
(C) keyword      (D) instance
Answer: D
9.       What would be returned by the following recursive function after we call test (0, 3)
int test (int a, int b)
{
if (a==b) return (1);
else if (a>b) return(0);
else return (a+test(a+1, b));
}
(A) 1       (B) 2
(C) 3       (D) 4
Answer: D
10.    The size of array int a[5]={1,2} is
(A) 4       (B) 12
(C) 10     (D) 6
Answer: C
Explanation:
The size of int array is 2*5=10 bytes as int takes 2 bytes of storage.


Post a Comment

0 Comments