Subject / 929 questions

Programming MCQs

Page 4 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 4 of 47

Advertisement
Question 66 C Language

Which condition must hold for strcat(dest, src) to work correctly?

Correct answer A. dest must hold a null-terminated string and have room for both strings plus one null byte

Open question
Advertisement
Question 71 C++

What is wrong with the function int& getValue() { int local = 5; return local; }?

Correct answer A. It returns a reference to a local variable that is destroyed when the function returns

Open question
Advertisement
Question 78 C++

What is the core idea of RAII (Resource Acquisition Is Initialisation) in C++?

Correct answer C. A resource is tied to an object's lifetime, acquired in its constructor and released in its destructor

Open question