What is the output of the following program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int a = 5;
6.float b;
7.cout << sizeof(++a + b);
8.cout << a;
9.return 0;
10.}
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.char arr[20];
6.int i;
7.for(i = 0; i < 10; i++)
8.*(arr + i) = 65 + i;
9.*(arr + i) = '\0';
10.cout << arr;
11.return(0);
12.}
Which is used to indicate single precision value?
Which of three sizes of floating point types should be used when extended precision is required?
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?
Which classes allow primitive types to be accessed as objects?
What is the output of this program? 1.#include
2.using namespace std;
3.#define PI 3.14159
4.int main ()
5.{
6.float r = 2;
7.float circle;
8.circle = 2 * PI * r;
9.cout << circle;
10.return 0;
11.}
Is bool a fundamental datatype in C++?
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.}
The difference between x and ‘x’ is
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.}
96. The output of this program is int main () { cout << "Hello World!" return 0; }
What is the output of this program?
1.#include
2.using namespace std;
3.int func(void *Ptr);
4.int main()
5.{
6.char *Str = "abcdefghij";
7.func(Str);
8.return 0;
9.}
10.int func(void *Ptr)
11.{
12.cout << Ptr;
13.return 0;
14.}
What is meaning of following declaration? int(*p[5])();
Select the right option: Given the variables p, q are of char type and r, s, t are of int type (1) t = (r * s) / (r + s); (2) t = (p * q) / (r + s);
Identify the type of the variables. typedef char* CHAR;. CHAR p,q;
What is the range of the floating point numbers?
What will be the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int a = 8;
6.cout << "ANDing integer 'a' with 'true' :" << a && true;
7.return 0;
8.}
What does a escape code represent?
The return value of the following code is Class1& test(Class1 obj) Class1 *ptr = new Class1(); _________ return ptr;
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int arr[] = {4, 5, 6, 7};
6.int *p = (arr + 1);
7.cout << *arr + 9;
8.return 0;
9.}
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int array[] = {10, 20, 30};
6.cout << -2[array];
7.return 0;
8.}
Evaluate the following (false && true) || false || true
Which is correct with respect to size of the datatypes?
How do we define a constructor?
Which of these expressions will isolate the rightmost set bit?
Which of the following correctly declares an array?
The value 132.54 can represented using which data type?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int const p = 5;
6.cout << ++p;
7.return 0;
8.}
Which of the following keyword supports dynamic method resolution?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int arr[] = {4, 5, 6, 7};
6.int *p = (arr + 1);
7.cout << arr;
8.return 0;
.}
The operator used for dereferencing or indirection is ____
Which of the two operators ++ and — work for the bool datatype in C++?
What is the value of p? 1.#include 2.
3.using namespace std;
4.int main()
5.{
6.int p;
7.bool a = true;
8.bool b = false;
9.int x = 10;
10.int y = 5;
11.p = ((x | y) + (a + b));
12.cout << p;
13.return 0;
14.}
Which of the following statements are false?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int a = 10;
6.if (a < 10) {
7.for (i = 0; i < 10; i++)
8.cout << i;
9.}
10.else {
11.cout << i;
12.}
13.return 0;
14.}
If the class name is X, what is the type of its “this” pointer (in a nonstatic, non-const member function)?
The value 132.54 can represented using which data type?
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.}
How do we declare an ‘interface’ class?