Cpp Programming 16

COEP
Lets Crack Online Exam

IT Interview Exam Questions: Cpp Programming 16 (IT Interview Exam Question, IT Campus Placement)

Subject: Cpp Programming 16

Part 16: List for questions and answers of C ++ Language

 

Q1. What is a template?

a) A template is a formula for creating a generic class

b) A template is used to manipulate the class

c) A template is used for creating the attributes

d) none of the mentioned

 

Q2. Pick out the correct statement about string template?

a) It is used to replace a string

b) It is used to replace a string with another string at runtime

c) It is used to delete a string

d) none of the mentioned

 

Q3. What may be the name of the parameter that the template should take?

a) same as template

b) same as class

c) same as function

d) none of the mentioned

 

Q4. How many parameters are legal for non-type template?

a) 1

b) 2

c) 3

d) 4

 

Q5. What is a function template?

a) creating a function without having to specify the exact type

b) creating a function with having a exact type

c) both a and b

d) none of the mentioned

 

Q6. Which is used to describe the function using placeholder types?

a) template parameters

b) template type parameters

c) template type

d) none of the mentioned 

 

Q7. hat can be passed by non-type template parameters during compile time?

a) int

b) float

c) constant expression

d) none of the mentioned

 

Q8. From where does the template class derived?

a) regular non-templated C++ class

b) templated class

c) a or b

d) none of the mentioned

 

Q9. What is meant by template parameter?

a) It can be used to pass a type as argument

b) It can be used to evaluate a type

c) It can of no return type

d) None of the mentioned

 

Q10. Which keyword can be used in template?

a) class

b) typename

c) both a and b

d) function

 

Q11. What is the validity of template parameters?

a) inside that block only

b) inside the class

c) whole program

d) any of the mentioned

 

Q12. Why we use :: template-template parameter?

a) binding

b) rebinding

c) both a and b

d) none of these

 

Q13. Which parameter is legal for non-type template?

a) pointer to member

b) object

c) class

d) none of the mentioned 

 

Q14. Which of the things does not require instantiation?

a) functions

b) non virtual member function

c) member class

d) all of the mentioned

 

Q15. What is meant by template specialization?

a) It will have certain data types to be fixed

b) It will make certain data types to be dynamic

c) Certain data types are invalid

d) None of the mentioned

 

Q16. Which is similar to template specialization?

a) template

b) function overloading

c) function template overloading

d) None of the mentioned

 

Q17. Where does a cin stops it extraction of data?

a) By seeing a blankspace

b) By seeing ()

c) Both a and b

d) None of the mentioned

 

Q18. How many parameters are there in getline function?

a) 1

b) 2

c) 3

d) 4

 

Q19. When will the cin can start proceessing of input?

a) After pressing return key

b) BY pressing blankspace

c) Both a and b

d) None of the mentioned

 

20. How many types of templates are there in c++?

a) 1

b) 2

c) 3

d) 4 

 

Part 16: List for questions and answers of C ++ Language

 

Q1. Answer: a

 

Q2. Answer: b

 

Q3. Answer: a

 

Q4. Answer: d

 

Q5. Answer: a

 

Q6. Answer: b

 

Q7. Answer: c

 

Q8. Answer: c

 

Q9. Answer: a

 

Q10. Answer: c

 

Q11. Answer: a

 

Q12. Answer: c

 

Q13. Answer: a

 

Q14. Answer: d

 

Q15. Answer: a

 

Q16. Answer: c

 

Q17. Answer: a

 

Q18. Answer: c

 

Q19. Answer: a

 

Q20. Answer: b