1
Q:

What is the output of this program?

#include
        using namespace std;
        struct sec {
            int a;
            char b;
        };
        int main()
        {
            struct sec s ={25,50};
            struct sec *ps =(struct sec *)&s;
            cout << ps->a << ps->b;
            return 0;
        }

A) 252 B) 253
C) 254 D) 262

Answer:   A) 252



Explanation:

In this program, We are dividing the values of a and b, printing it.

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 4284
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 4859
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 3378
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 3219
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 5587
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 4621
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 2871
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 7492