C++ Programming MCQ (Multiple Choice Questions) - SchoolingAxis

 

C++ Programming MCQ (Multiple Choice Questions)

Que- Which of the following is the correct syntax of including a user defined header files in C++? 

a. #include <userdefined.h> 

b. #include <userdefined> 

c. #include "userdefined" 

d. #include [userdefined] 


Answer- #include "userdefined"        


Que- Which of the following is a correct identifier in C++? 

a. 7var_name 

b. 7VARNAME 

c. VAR_1234 

d. $var_name 


Answer- VAR_1234        


Que- Which of the following is called address operator? 

a. * 

b. & 

c. _ 

d. % 


Answer- &        


Que- Which of the following is used for comments in C++? 

a. // comment 

b. /* comment */ 

c. both // comment or /* comment */ 

d. // comment */ 


Answer- both // comment or /* comment */        


Que- What are the actual parameters in C++? 

a. Parameters with which functions are called 

b. Parameters which are used in the definition of a function 

c. Variables other than passed parameters in a function 

d. Variables that are never used in the function 


Answer- Parameters with which functions are called        


Que- What are the formal parameters in C++? 

a. Parameters with which functions are called 

b. Parameters which are used in the definition of the function 

c. Variables other than passed parameters in a function 

d. Variables that are never used in the function 


Answer- Parameters which are used in the definition of the function        


Que- Which function is used to read a single character from the console in C++? 

a. cin.get(ch) 

b. getline(ch) 

c. read(ch) 

d. scanf(ch) 


Answer- cin.get(ch)        


Que- Which function is used to write a single character to console in C++? 

a. cout.put(ch) 

b. cout.putline(ch) 

c. write(ch) 

d. printf(ch) 


Answer- cout.put(ch)        


Que- What are the escape sequences? 

a. Set of characters that convey special meaning in a program 

b. Set of characters that whose use are avoided in C++ programs 

c. Set of characters that are used in the name of the main function of the program 

d. Set of characters that are avoided in cout statements 


Answer- Set of characters that convey special meaning in a program        


Que- Who created C++? 

a. Bjarne Stroustrup 

b. Dennis Ritchie 

c. Ken Thompson 

d. Brian Kernighan 


Answer- Bjarne Stroustrup        


Que- Which of the following is called insertion/put to operator? 

a. << 

b. >> 

c. > 

d. < 


Answer- <<        


Que- Which of the following is called insertion/put to operator? 

a. << 

b. >> 

c. > 

d. < 


Answer- >>        


Que- A language which has the capability to generate new data types are called ________________ 

a. Extensible 

b. Overloaded 

c. Encapsulated 

d. Reprehensible 


Answer- Extensible        


Que- Wrapping data and its related functionality into a single entity is known as _____________ 

a. Abstraction 

b. Encapsulation 

c. Polymorphism 

d. Modularity 


Answer- Encapsulation        


Que- How structures and classes in C++ differ? 

a. Classes follows OOP concepts whereas structure does not 

b. In Structures, members are private by default whereas in Classes they are public by default 

c. Structures by default hide every member 

d. Classes and Structures are the same 


Answer- Classes follows OOP concepts whereas structure does not        


Que- What does polymorphism in OOPs mean? 

a. Concept of allowing overiding of functions 

b. Concept of hiding data 

c. Concept of keeping things in differnt modules/files 

d. Concept of wrapping things into a single unit 


Answer- Concept of allowing overiding of functions        


Que- Which concept allows you to reuse the written code? 

a. Encapsulation 

b. Abstraction 

c. Inheritance 

d. Polymorphism 


Answer- Inheritance        


Que- Which of the following shows multiple inheritances? 

a. A->B->C 

b. A->B; A->C 

c. A,B->C 

d. B->A 


Answer- A,B->C        


Que- How access specifiers in Class helps in Abstraction? 

a. They does not helps in any way 

b. They allows us to show only required things to outer world 

c. They help in keeping things together 

d. Abstraction concept is not used in classes 


Answer- They allows us to show only required things to outer world        


Que- C++ is ______________ 

a. procedural programming language 

b. object oriented programming language 

c. functional programming language 

d. both procedural and object oriented programming language 


Answer- both procedural and object oriented programming language.

Previous Post Next Post