0
Q:

What is the output of this program?

#include
        using namespace std;
        void fun(int x, int y)
        {
            x = 20;
            y = 10;
        }
        int main()
        {
            int x = 10;
            fun(x, x);
            cout << x;
            return 0;
        }

A) 10 B) 20
C) compile time error D) none of these

Answer:   A) 10



Explanation:

In this program, we called by value so the value will not be changed, So the output is 10

Subject: C++
Q:

Pick out the correct method in the c++ standard library algorithm.

A) mismatch B) maximum
C) minimum D) None of these
 
Answer & Explanation Answer: A) mismatch

Explanation:

It is a method in the search opertion in standard library algorithms.

Report Error

View Answer Report Error Discuss

Filed Under: C++

2 4282
Q:

What is mandatory for designing a new container?

A) Classes B) Iterators
C) Container D) None of these
 
Answer & Explanation Answer: B) Iterators

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

0 4849
Q:

How many items are presented in the associate container?

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

Explanation:

There are 5 items presented in the associate container. They are set, multiset, map, multimap and bitset.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3372
Q:

What does the sequence adaptor provide?

A) Insertion B) Deletion
C) Interface to sequence container D) None of thse
 
Answer & Explanation Answer: C) Interface to sequence container

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3215
Q:

What do vectors represent?

A) Static arrays B) Dynamic arrays
C) Stack D) Queue
 
Answer & Explanation Answer: B) Dynamic arrays

Explanation:

Vectors are sequence containers representing arrays that can change in size.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 5572
Q:

How the member functions in the container can be accessed?

A) Iterator B) Indirect
C) Both a & b D) None of these
 
Answer & Explanation Answer: A) Iterator

Explanation:

The container manages the storage space for its elements and provides member functions to access them, either directly or through iterators which reference objects with similar properties to pointers.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 4611
Q:

Which is best for coding the standard libary for c++?

A) no trailing underscores on names B) complex objects are returned by value
C) have a member-swap() D) All of the mentioned
 
Answer & Explanation Answer: D) All of the mentioned

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 2865
Q:

To which type of class, We can apply RTTI?

A) Encapsulation B) Polymorphic
C) Derived D) None of these
 
Answer & Explanation Answer: B) Polymorphic

Explanation:

RTTI is available only for classes which are polymorphic, which means they have at least one virtual method.

Report Error

View Answer Report Error Discuss

Filed Under: C++

0 7475