Which of the following operators can be implemented as a nonmember operator?
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);
What are the parts of the literal constants?
The constants are also called as
The operator used for dereferencing or indirection is ____
What will happen when the structure is declared?
How to declare a wide character in string literal?
What is the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.void a = 10, b = 10;
6.int c;
7.c = a + b;
8.cout << c;
9.return 0;
10.}
What does a reference provide?
What is the output of the following program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int num1 = 10;
6.float num2 = 20;
7.cout << sizeof(num1 + num2);
8.return 0;
9.}
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.}
The data elements in structure are also known as what?
What is the output of this program? 1.#include
2.using namespace std;
3.void swap(int &a, int &b);
4.int main()
5.{
6.int a = 5, b = 10;
7.swap(a, b);
8.cout << "In main " << a << b;
9.return 0;
10.}
11.void swap(int &a, int &b)
12.{
13.int temp;
14.temp = a;
15.a = b;
16.b = temp;
17.cout << "In swap " << a << b;
18.}
STL is based on which of the following programming paradigms?
What is meaning of following declaration? int(*p[5])();
Evaluate the following. (false && true) || false || true
What is the output of this program? 1.#include
2.using namespace std;
3.void addprint()
4.{
5.static int s = 1;
6.s++;
7.cout << s;
8.}
9.int main()
10.{
11.addprint();
12.addprint();
13.addprint();
14.return 0;
15}
The value 132.54 can represented using which data type?
When class B is inherited from class A, what is the order in which the constructers of those classes are called
What happens when a null pointer is converted into bool?
What is the output of this program?
1.#include
2.using namespace std;
3.int main()
4.{
5.int n = 5;
6.void *p = &n;
7.int *pi = static_cast(p);
8.cout << *pi << endl;
9.return 0;
10.}
What does the following statement mean? int (*fp)(char*)
When does the void pointer can be dereferenced?
What’s wrong? (x = 4 && y = 5) ? (a = 5) ; (b = 6);
Void pointer can point to which type of objects?
The difference between x and ‘x’ is
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.}
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.}
Identify the user-defined types from the following?
96. The output of this program is int main () { cout << "Hello World!" return 0; }
How do we define a constructor?
What is the value of the following 8-bit integer after all statements are executed?
int x = 1;
x = x << 7;
x = x >> 7;
There is nothing like a virtual constructor of a class.
Which of the STL containers store the elements contiguously (in adjacent memory locations)?
The declaration of structure is also called as?
Observe following program and answer 100 class Example{public: int a,b,c; Example(){a=b=c=1;} //Constructor 1 Example(int a){a = a; b = c = 1;} //Constructor 2 Example(int a,int b){a = a; b = b; c = 1;} //Constructor 3 Example(int a,int b,int c){ a = a; b = b; c = c;} //Constructor 4 } In the above example of constructor overloading, the following statement will call which constructor Example obj = new Example (1,2,3);