1
Q:

What is the output of this program ?

       #include
        using namespace std;
        int n(char, int);
        int (*p) (char, int) = n;
        int main()
        {
            (*p)('d', 9);
            p(10, 9);
            return 0;
        }
        int n(char c, int i)
        {
            cout << c <<  i;
            return 0;
        }

A) d99 B) d9d9
C) d9 D) compile time error

Answer:   A) d99



Explanation:

In this program, we have declared the values as integer instead of character, So it is printing as d99 but it will not arise an error.

Subject: C++
Q:

What is a template?

A) A template is a formula for creating a generic class B) A template is used to manipulate the class
C) A template is used for creating the attributes D) none of the mentioned
 
Answer & Explanation Answer: A) A template is a formula for creating a generic class

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3177
Q:

How many kinds of classes are there in c++?

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: B) 2

Explanation:

There are two kinds of classes in c++. They are absolute class and concrete class.

Report Error

View Answer Report Error Discuss

Filed Under: C++

7 10203
Q:

How many types of constructor are there in C++?

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: C) 3

Explanation:

There are three types of constructor in C++. They are Default constructor, Parameterized constructor, Copy constructor.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3710
Q:

What does inheriatance allows you to do?

A) create a class B) access methods
C) create a hierarchy of classes D) None of the mentioned
 
Answer & Explanation Answer: C) create a hierarchy of classes

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3328
Q:

How many ways of reusing are there in class hierarchy?

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: B) 2

Explanation:

Class hierarchies promote reuse in two ways. They are code sharing and interface sharing.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 6257
Q:

What is meant by pure virtual function?

A) Function which does not have definition of its own. B) Function which does have definition of its own.
C) Function which does not have any return type. D) None of the mentioned
 
Answer & Explanation Answer: A) Function which does not have definition of its own.

Explanation:

As the name itself implies, it have to depend on other class only.

Report Error

View Answer Report Error Discuss

Filed Under: C++

2 4736
Q:

Which is also called as abstract class?

A) virtual function B) pure virtual function
C) derived class D) None of these
 
Answer & Explanation Answer: B) pure virtual function

Explanation:

Classes that contain at least one pure virtual function are called as abstract base classes.

Report Error

View Answer Report Error Discuss

Filed Under: C++

8 10422
Q:

Which of the following can derived class inherit?

A) members B) functions
C) both a & b D) None of the above
 
Answer & Explanation Answer: C) both a & b

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

2 6482