Cpp Programming 7

COEP
Lets Crack Online Exam

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

Subject: Cpp Programming 7

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

 

Q1. The data elements in structure are also known as what?

a) objects

b) members

c) datas

d) none of the mentioned

 

Q2. What will be used when terminating a structure?

a) :

b) }

c) ;

d) ;;

 

Q3. What will happen when the structure is declared?

a) it will not allocate any memory

b) it will allocate the memory

c) it will be declared and initialized

d) none of the mentioned

 

Q4. The declaration of structure is also called as?

a) sructure creator

b) structure signifier

c) structure specifier

d) none of the mentioned

 

Q5. The constants are also called as

a) const

b) preprocessor

c) literals

d) none of the mentioned

 

Q6. What are the parts of the literal constants?

a) integer numerals

b) floating-point numerals

c) strings and boolean values

d) all of the mentioned 

 

Q7. How the constants are declared?

a) const keyword

b) #define preprocessor

c) both a and b

d) None of the mentioned

 

Q8. Which of the following statement is not true about preprocessor directives?

a) These are lines read and processed by the preprocessor

b) They do not produce any code by themselves

c) These must be written on their own line

d) They end with a semicolon

 

Q9. Regarding following statement which of the statements is true? const int a = 100;

a) Declares a variable a with 100 as its initial value

b) Declares a construction a with 100 as its initial value

c) Declares a constant a whose value will be 100

d) Constructs an integer type variable with a as identifier and 100 as value

 

Q10. The difference between x and ‘x’ is

a) The first one refers to a variable whose identifier is x and the second one refers to the character constant x

b) The first one is a character constant x and second one is the string literal x

c) Both are same

d) None of the mentioned

 

Q11. How to declare a wide character in string literal?

a) L prefix

b) l prefix

c) W prefix

d) none of the mentioned

 

Q12. Which of the following is correct about class and structure?

a) class can have member functions while structure cannot

b) class data members are public by default while that of structure are private

c) Pointer to structure or classes cannot be declared

d) class data members are private by default while that of structure are public by default 

 

Q13. Which of the following is the only technical difference between structures and classes in C++?

a) Member function and data are by default protected in structures but private in classes

b) Member function and data are by default private in structures but public in classes

c) Member function and data are by default public in structures but private in classes

d) Member function and data are by default public in structures but protected in classes

 

Q14. Which of the following are true about classes and struct?

1.A class is a reference type, whereas a struct is a value type.

2.Objects are created using new, whereas structure variables can be created either using new or without using new.

3.A structure variable will always be created slower than an object

a) 1, 2

b) 1

c) 2, 3

d) 1, 2, 3

 

Q15. Identify the incorrect option

a) enumerators are constants

b) enumerators are user defined types

c) enumerators are same as macros

d) enumerator values start from 0 by default

 

Q16. In which type does the enumerators are stored by the compiler?

a) string

b) integer

c) float

d) none of the mentioned

 

Q17. To which of these enumerators can be assigned?

a) integer

b) negative

c) enumerator

d) all of the mentioned 

 

Q18. What will happen when defining the enumerated type?

a) it will not allocate memory

b) it will allocate memory

c) it will not allocate memory to its variables

d) none of the mentioned

 

Q19. Which variable does equals in size with enum variable?

a) int variable

b) float variable

c) string variable

d) none of the mentioned

 

Q20. The difference between x and ‘x’ is

a) The first one refers to a variable whose identifier is x and the second one refers to the character constant x

b) The first one is a character constant x and second one is the string literal x

c) Both are same

d) None of the mentioned

 

Q21. How to declare a wide character in string literal?

a) L prefix

b) l prefix

c) W prefix

d) none of the mentioned 

 

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

 

Q1. Answer: b

 

Q2. Answer: c

 

Q3. Answer: a

 

Q4. Answer: c

 

Q5. Answer: c

 

Q6. Answer: d

 

Q7. Answer: c

 

Q8. Answer: d

 

Q9. Answer: c

 

Q10. Answer: a

 

Q11. Answer: a

 

Q12. Answer: d

 

Q13. Answer: c

 

Q14. Answer: a

 

Q15. Answer: c

 

Q16. Answer: b

 

Q17. Answer: d

 

Q18. Answer: a

 

Q19. Answer: a

 

Q20. Answer: a

 

Q21. Answer: a