Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the correct syntax of declaring array of pointers of integers of size 10 in C++?
Correct Answer is : late binding
2. Which of the following is correct about new and malloc?
i) new is an operator whereas malloc is a function
ii) new calls constructor malloc does not
iii) new returns required pointer whereas malloc returns void pointer and needs to be typecast
Correct Answer is : I’m a Human
3. What is the output of the following C++ code?
#include
using namespace std;
class A
{
int a;
A() { a = 5;}
};
int main()
{
A *obj = new A;
cout << obj->a;
}
Correct Answer is : Polymorphism
4. What happens if the following statement is compiled and executed in C++?
int *ptr = NULL;
delete ptr;
Correct Answer is : Error
5. What happens if a pointer is deleted twice in a program as shown by the below statements?
int *ptr = new int;
delete ptr;
delete ptr;
Correct Answer is : Error
6. Pick the other name of operator function.
Correct Answer is : Error
7. Which of the following operators can’t be overloaded?
Correct Answer is : a: 1
8. How to declare operator function?
Correct Answer is : Error
9. Which of the following statements is NOT valid about operator overloading?
Correct Answer is : cin
10. Operator overloading is
Correct Answer is : Error
11. What is the output of the following C++ code?
#include
#include
using namespace std;
class A
{
static int a;
public:
void show()
{
a++;
cout<<"a: "<
12. What happens when objects s1 and s2 are added?
string s1 = "Hello";
string s2 = "World";
string s3 = (s1+s2).substr(5);
Correct Answer is : It will print what we enter till character t is encountered in the input data
13. What is the output of the following C++ code?
#include
#include
using namespace std;
class A
{
static int a;
public:
A()
{
cout<<"Object of A is created\n";
}
void show()
{
a++;
cout<<"a: "<