I need help in MCQs

User Generated

cnegvnyareq

Programming

programming concepts

Harvard University

Description

These are the MCQs

Unformatted Attachment Preview

1. Who invented C++? a) Dennis Ritchie b) Ken Thompson c) Brian Kernighan d) Bjarne Stroustrup 2. What is C++? a) C++ is an object oriented programming language b) C++ is a procedural programming language c) C++ supports both procedural and object oriented programming language d) C++ is a functional programming language 3. Which of the following is the correct syntax of including a user defined header files in C++? a) #include [userdefined] b) #include “userdefined” c) #include d) #include 4. Which of the following is used for comments in C++? a) /* comment */ b) // comment */ c) // comment d) both // comment or /* comment */ 5. Which of the following user-defined header file extension used in c++? a) hg b) cpp c) h d) hf 6. Which of the following is a correct identifier in C++? a) VAR_1234 b) $var_name c) 7VARNAME d) 7var_name 7. Which of the following is not a type of Constructor in C++? a) Default constructor b) Parameterized constructor c) Copy constructor d) Friend constructor 8. Which of the following approach is used by C++? a) Left-right b) Right-left c) Bottom-up d) Top-down 9. What is virtual inheritance in C++? a) C++ technique to enhance multiple inheritance b) C++ technique to ensure that a private member of the base class can be accessed somehow c) C++ technique to avoid multiple inheritances of classes d) C++ technique to avoid multiple copies of the base class into children/derived class 10. What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr; a) The program is not semantically correct b) The program is compiled and executed successfully c) The program gives a compile-time error d) The program compiled successfully but throws an error during run-time 11. What will be the output of the following C++ code? #include #include using namespace std; int main(int argc, char const *argv[]) { char s1[6] = "Hello"; char s2[6] = "World"; char s3[12] = s1 + " " + s2; cout
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached.

Answers
1D
2C
3B
4D
5C
6A
7D
...

Related Tags