C++
Variables and Data Types
MCQs
MCQs
Q1 - A variable precisely represents :
a) String b) Number
c) A location in memory d) nothing
Q2 - Information stored inside a variable is :
a) Data type b) Literal
c) Value d) Operator
Q3 - Which of the following C++ declarations is invalid?
a) bool var b) integer var
c) double var d) char var
Q4 - Which of the following holds alphanumeric using character encoding?
a) int b) bool
c) string d) decimal
Q5 - Which data type has 8 bytes of memory allocated and holds integers or real numbers?
a) int b) bool
c) double d) string
Answers:
Ans 1: c) A location in memory
Ans 2: c) Value
Ans 3: b) integer var
Ans 4: c) string
Ans 5: c) double
Cracking the Coding Interview in C++ - Foundation