A property which is not true for classes is that they
![]()
Practice Objects and Classes –
A property which is not true for classes is that they
A property which is not true for classes is that they
![]()
Practice Objects and Classes –
A property which is not true for classes is that they
![]()
Practice Objects and Classes –
What will be the output of following program?
#include<iostream>
using namespace std;
class base {
int arr[10];
};
class b1: public base { };
class b2: public base { };
class derived: public b1, public b2 {};
int main(void)
{
cout << sizeof(derived);
return 0;
}An array element is accessed using
![]()
Practice Memory Management –
An array element is accessed using
If an array is declared as
int a[4] = {3, 0, 1, 2}, then values
![]()
Practice Memory Management –
If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________.
![]()
Practice OOPS Concepts –
What is the output of the following code
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];
When would a structure variable get destroyed?
![]()
Practice OOPS Concepts –
When would a structure variable get destroyed?
Which of the following statements are correct?
![]()
Practice References –
Which of the following statements are correct?
How many bytes will the structure variable samp occupy in
![]()
Practice OOPS Concepts –
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial {
int i;
Decimal d;
}
struct Sample {
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();Which of the following is the correct way to define a variable of t
![]()
Practice OOPS Concepts –
Which of the following is the correct way to define a variable of the type struct Emp declared below?
struct Emp {
private String name;
private int age;
private Single sal;
}Which of the following is the correct way of setting values into th
![]()
Practice OOPS Concepts –
Which of the following is the correct way of setting values into the structure variable e defined below?
struct Emp {
public String name;
public int age;
public Single sal;
}
Emp e = new Emp();In C++, dynamic memory allocation is accomplished with the operator
![]()
Practice Memory Management –
In C++, dynamic memory allocation is accomplished with the operator ____________.
Find the output of the following program for n=5
![]()
Practice OOPS Concepts –
Find the output of the following program for n=5
int foo(int n) {
if(n == 0)
return 1;
else {
int sum = 0;
for(int i=foo(n-1); i<n; i++)
sum += foo(i);
}
return sum;
}
Which of the following statements are true in c++?
![]()
Practice OOPS Concepts –
Which of the following statements are true in c++?
Which of the following expressions is illegal?
![]()
Practice Templates –
Which of the following expressions is illegal?
What will be the output of the following program?
![]()
Practice File Handling –
What will be the output of the following program?
#include<iostream.h>
int main() {
int x = 10, y = 20;
int *ptr = &x;
int &ref = y;
*ptr++;
ref++;
cout<< x << " " << y;
return 0;
}