Explore topic-wise MCQs in C++ Programming.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the syntax of declaraing a forward_list?

A. forward_list f;
B. forward_list<type> f;
C. forward_list f<type>;
D. forward_list<type,size> f;
Answer» C. forward_list f<type>;
2.

How the list differs from vectors?

A. Vector is contiguous whereas List is non-contiguous
B. Insertion in the list takes constant time whereas it is not constant in vectors
C. There is no capacity defined for list
D. All of the mentioned
Answer» E.
3.

Which of the following(s) is/are the correct way of assigning values to a forward_list f?

A. f.assign({1,2,3,4,5})
B. f.assign(10,5)
C. both f.assign({1,2,3,4,5}) and f.assign(10,5)
D. f.assign(1,1,1,1)
Answer» D. f.assign(1,1,1,1)
4.

Which of the following header file is required for forwawrd_list?

A. <forward_list>
B. <list>
C. <f_list>
D. <Forward_List>
Answer» B. <list>
5.

Which type of list a List sequence container implements?

A. Singly Linked List
B. Doubly Linked List
C. Both type of list
D. A simple sequence of array
Answer» C. Both type of list
6.

Which type of list a Forward_list sequence container implements?

A. Singly Linked List
B. Doubly Linked List
C. Both type of list
D. A simple sequence of array
Answer» B. Doubly Linked List
7.

How many list sequence containers are provided by STL?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3