

MCQOPTIONS
Saved Bookmarks
This section includes 1112 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
1101. |
What is the syntax of defining lambda expression? |
A. | [capture clause](parameters) -> return_type { body of the function } |
B. | [parameters](capture clause) -> return_type { body of the function } |
C. | [parameters:capture clause]() -> return_type { body of the function } |
D. | [capture clause:parameters]() -> return_type { body of the function } |
Answer» B. [parameters](capture clause) -> return_type { body of the function } | |
1102. |
Which of the following operator is used to capture all the external variable by reference? |
A. | & |
B. | = |
C. | * |
D. | && |
Answer» B. = | |
1103. |
Which of the following is correct about the first parameter of the main function? |
A. | First argument is of int type |
B. | Stores the count of command line arguments |
C. | First argument is non-negative |
D. | All of the mentioned |
Answer» E. | |
1104. |
To use command line arguments in C++, how many parameters are passed to the main function? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» C. 3 | |
1105. |
What does the second parameter of the main function represent? |
A. | Number of command line arguments |
B. | List of command line arguments |
C. | Dictionary of command line arguments |
D. | Stack of command line arguments |
Answer» C. Dictionary of command line arguments | |
1106. |
What does the first parameter of the main function represent? |
A. | Number of command line arguments |
B. | List of command line arguments |
C. | Dictionary of command line arguments |
D. | Stack of command line arguments |
Answer» B. List of command line arguments | |
1107. |
Which of the following gives the name of the program if the second parameter to the main fucntion is char **argv? |
A. | argv[3] |
B. | argv[1] |
C. | argv[0] |
D. | argv[2] |
Answer» D. argv[2] | |
1108. |
Which character is used to separate different arguments? |
A. | # |
B. | $ |
C. | space |
D. | | |
Answer» D. | | |
1109. |
What are command line arguments? |
A. | Arguments passed to main() function |
B. | Arguments passed to any function |
C. | Arguments passed to class functions |
D. | Arguments passed to structure functions |
Answer» B. Arguments passed to any function | |
1110. |
Which is the correct way of handling arguments with spaces? |
A. | Use single quotes |
B. | Either single or double quotes |
C. | Use double quotes |
D. | There is no way of handling arguments with space |
Answer» C. Use double quotes | |
1111. |
What is the signature of math in function using command line arguments? |
A. | int main(int argc, char const *argv[]); |
B. | int main(int argc, char const **argv); |
C. | int main(int argc, char **argv); |
D. | all of the mentioned |
Answer» E. | |
1112. |
Which of the following operator is used to capture all the external variable by value? |
A. | & |
B. | = |
C. | * |
D. | && |
Answer» C. * | |