What should be the data type of fact?
void main() {
\_\_\_\_\_\_\_ fact = 1;
for (int i = 1; i <= 20; i++) {
fact *= i; }a) int
b) long
c) long long
d) int*
c
What is NOT true about l-value?
a) It refers to a memory location
b) It is a data value stored at some address in
the memory
c) A value can be assigned to it
d) It can appear at both the left and the right
hand side of an assignment
b
Which of the following is/are compound data type(s)?
a) String
b) Array
c) Pointer
d) Short
e) B and C above
f) A, B and C above
f
What is the value of x after this code is run? int x = 10; int * y = &x; int z = *y; z = 20; *y = 30;
a) 10
b) 20
c) 30
d) undefined
c
Which of these is not a type of memory allocation in C++?
a) Static
b) Const
c) Dynamic
d) Automatic
b
Which of the following assignments is valid?
a) char foo[] = “Hello”;
b) foo = “Hi!”;
c) foo[] = “Hello”;
d) foo[i] = “Hi!”;
e) A and D above
a