The default access level assigned to members of a class is ___________.
What is the output of this program? 1.#include
2.using namespace std;
3.int main ()
4.{
5.int numbers[5];
6.int * p;
7.p = numbers; *p = 10;
8.p++; *p = 20;
9.p = &numbers[2]; *p = 30;
10.p = numbers + 3; *p = 40;
11.p = numbers; *(p + 4) = 50;
12.for (int n = 0; n < 5; n++)
13. cout << numbers[n] << ",";
14. return 0;
15.}
Which reference modifier is used to define reference variable?
For what values of the expression is an if-statement block not executed?
Which is used to indicate single precision value?
How do we define a constructor?
Which of the following correctly describes C++ language?
What happens when a null pointer is converted into bool?
What will be the output of this program? 1.#include
2.using namespace std;
3. int main()
4.{
5.char c = 74;
6.cout << c;
7.return 0;
8.}
For what values of the expression is an if-statement block not executed?
Identify the user-defined types from the following?
What will be output of this function? 1.int main()
2.{
3.register int i = 1;
4.int *ptr = &i;
5.cout << *ptr;
6.return 0;
7.}
What is the output of this program? 1.include
2.using namespace std;
3.int g = 100;
4.int main()
5.{
6.int a;
7.{
8.int b;
9.b = 20;
10.a = 35;
11.g = 65;
12.cout << b << a << g;
13.}
14.a = 50;
15.cout << a << g;
16.return 0;
17.}
Identify the incorrect option.
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.char *ptr;
6.char Str[] = "abcdefg";
7.ptr = Str;
8.ptr += 5;
9.cout << ptr;
10.return 0;
11.}
What is the value of the following 8-bit integer after all statements are executed?
int x = 1;
x = x << 7;
x = x >> 7;
Which of the following keyword supports dynamic method resolution?
The output of this program is int a = 10; void main(){ int a = 20; cout << a << ::a;}
How do we declare an ‘interface’ class?
Which of the following accesses the seventh element stored in array?
What will be the output of this program? 1.#include
2.using namespace std;
3.int array1[] = {1200, 200, 2300, 1230, 1543};
4.int array2[] = {12, 14, 16, 18, 20};
5.int temp, result = 0;
6.int main()
7.{
8.for (temp = 0; temp < 5; temp++) {
9.result += array1[temp];
10.}
11.for (temp = 0; temp < 4; temp++) {
12.result += array2[temp];
13.}
14.cout << result;
15.return 0;
16.}
What is the output of this program?
1.#include
2.using namespace std;
3.int main()
4.{
5.int a = 5, c;
6.void *p = &a;
7.double b = 3.14;
8.p = &b;
9.c = a + b;
10.cout << c << '\n' << p;
11.return 0;
12.}
Value of a in a = (b = 5, b + 5); is
Which of the following is not recommended in a header file?
What is the output of the following program? 1.#include
2.using namespace std;
3.int main()
4.{
5.float i = 123.0f;
6.cout << i << endl;
7.return 0;
8.}
The declaration of structure is also called as?
Which of the following is the most general exception handler that catches exception of any type?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int a[2][4] = {3, 6, 9, 12, 15, 18, 21, 24};
6.cout << *(a[1] + 2) << *(*(a + 1) + 2) << 7.2[1[a]];
7.return 0;
8.}
Which of the following is not a standard exception built in C++.
In which type does the enumerators are stored by the compiler?
The data elements in structure are also known as what?
Which value we cannot assign to reference?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.float num1 = 1.1;
6.double num2 = 1.1;
7.if(num1 == num2)
8.cout << "stanford";
9.else
10.cout << "harvard";
11.return 0;
12.}
Which of the following below can perform conversions between pointers to related classes?
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?
What will happen in this code? int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
Which of the following is the most common way of implementing C++?