CDCDAC Prep
PGCP-ACCMCE (CCE Modules Exam)•20 Questions

C++ Programming Practice MCQs

Topic Covered in this Question Set

C++ Program Structure, Translation and Language Fundamentals

Click on an option to check your answer immediately. Full solution & explanation provided for every question.

Interactive Practice Mode

C++ Programming Free MCQs

Select an option to test your knowledge with real exam questions and instant explanations.

Total20
Correct0
Wrong0
Progress: 0 of 20 answered0% Accuracy
Q1 of 20

Which programming styles does C++ support?

Open topic in App →
Q2 of 20

Which phase handles #include directives?

Open topic in App →
Q3 of 20

Which build phase connects a call in main.o to the function's definition in math.o?

Open topic in App →
Q4 of 20

Which statement correctly contrasts C++ with C?

Open topic in App →
Q5 of 20

What return type does the C++ standard require for main?

Open topic in App →
Q6 of 20

After #include <iostream>, with no using declaration or directive, which statement compiles?

Open topic in App →
Q7 of 20

Which header must be included to use std::cout?

Open topic in App →
Q8 of 20

What does a declaration such as double area(double radius); introduce?

Open topic in App →
Q9 of 20

Which line is a function definition rather than only a declaration?

Open topic in App →
Q10 of 20

What does this code print? int count = 1; int Count = 2; std::cout << count + Count;

Open topic in App →
Q11 of 20

Which text begins a comment that runs to the end of the current line?

Open topic in App →
Q12 of 20

main.cpp includes circle.hpp, which declares double area(double), and calls area(2.0). The build command is g++ -std=c++17 main.cpp -o app, so circle.cpp (which defines area) is not compiled. What happens?

Open topic in App →
Q13 of 20

What does undefined behaviour mean in C++?

Open topic in App →
Q14 of 20

What does std::endl do in addition to inserting a newline?

Open topic in App →
Q15 of 20

Which C++17 feature lets auto [key, value] = entry; unpack a std::pair into two named variables?

Open topic in App →
Q16 of 20

Inside a function template, which C++17 construct tests a compile-time condition that depends on the template parameter and discards the unselected branch for that instantiation?

Open topic in App →
Q17 of 20

What is a translation unit?

Open topic in App →
Q18 of 20

Why does a header wrap its contents in #ifndef / #define / #endif guards?

Open topic in App →
Q19 of 20

Control reaches the closing brace of main without a return statement. What happens?

Open topic in App →
Q20 of 20

Why pass an option such as -std=c++17 to the compiler explicitly?

Open topic in App →
Need to review the concepts?

Read C++ Programming Study Notes

Review complete topic notes, syntax guides, code examples, and summary tables.

Read Free Study Notes →