Introduction to Programming MCQs with Answers
Practice important Introduction to Programming MCQs with answers and explanations.
Multiple Choice Questions
Q661: Which of the following describes the Standard Template Library (STL) in C++?
- A: A collection of tested and pre-developed templates
- B: A method to manually handle different data types
- C: A set of rules for writing template functions
- D: A library for non-generic programming
View Answer
A
Q662: What is the main purpose of the Matrix class described in the content?
- A: To handle complex numbers
- B: To perform various matrix operations
- C: To manage quadratic equations
- D: To process strings
View Answer
B
Q663: What is the order of a matrix with 3 rows and 4 columns?
- A: 4 * 3
- B: 3 * 4
- C: 3 + 4
- D: 45385
View Answer
B
Q664: How is the addition of two matrices performed?
- A: By adding their scalar values
- B: By adding corresponding elements
- C: By multiplying their corresponding elements
- D: By transposing both matrices
View Answer
B
Q665: What is the result of adding a scalar value to a matrix?
- A: Adding the scalar to each element of the matrix
- B: Adding the scalar to only the first element
- C: Adding the scalar to each row
- D: Adding the scalar to each column
View Answer
A
Q666: When subtracting two matrices, what is true about their dimensions?
- A: They must have the same number of rows and columns
- B: The number of rows can be different
- C: The number of columns can be different
- D: They must be square matrices
View Answer
A
Q667: How is the scalar division of a matrix represented?
- A: Each element is divided by the scalar
- B: The matrix is divided by the scalar
- C: The scalar is divided by each element
- D: The scalar is multiplied by each element
View Answer
A
Q668: What is the restriction for matrix multiplication?
- A: The number of columns in the first matrix must equal the number of rows in the second matrix
- B: The matrices must be square
- C: The matrices must be of the same size
- D: The number of rows must be equal
View Answer
A
Q669: How is the transpose of a matrix obtained?
- A: By reversing the order of elements
- B: By interchanging rows and columns
- C: By multiplying the matrix with a scalar
- D: By adding the matrix to itself
View Answer
B
Q670: What does the Matrix class constructor Matrix(int rows, int cols) do?
- A: It initializes the matrix with zero elements
- B: It allocates memory for the matrix
- C: It multiplies the matrix by a scalar
- D: It displays the matrix
View Answer
B