⟩ Static variable declared in a class are also called_________. a. instance variable b. named constant c. global variable d. class variable
d. class variable
d. class variable
What is meant by template parameter? a) It can be used to pass a type as argument b) It can be used to evaluate a type. c) It can of no return type d) None of the mentioned
Which parameter is legal for non-type template? a) pointer to member b) object c) class d) none of the mentioned
Why we use template-template parameter? a) binding b) rebinding c) both a & b d) none of these
What is the output of this program? #include <iostream> using namespace std; template <typename T, int count> void loopIt(T x) { T val[count]; for(int ii = 0; ii < count; ii++) { val[ii] = x++; cout << val[ii] << endl; } }; int main() { float xx = 2.1; loopIt<float, 3>(xx); } a) 2.1 b) 3.1 c) 4.1 d) 2.1 3.1 4.1
Is the size of character literals different in C and C++? a) Implementation defined b) Can't say c) Yes, they are different d) No, they are not different
What is the output of this program? #include <stdio.h> int main() { char a = '12'; printf("%d", a); return 0; } a) Compiler error b) 12 c) 10 d) Empty
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return? a) 4 b) 1 c) Implementation dependent d) Machine dependent
How do we represent a wide character of the form wchar_t? a) L'a' b) l'a' c) L[a] d) la
What will be the output of this program? #include <iostream> using namespace std; int main() { char c = 74; cout << c; return 0; } a) A b) N c) J d) I
Which of the following belongs to the set of character types? a) char b) wchar_t c) only a d) both a and b