CARVIEW |
Variables and Data Types in C++
This C++ Quiz will help you to test and validate your knowledge about variables and data types in C++. It covers a variety of questions, from basic to advanced. The quiz contains 20 questions. You just have to assess all the given options and click on the correct answer.
Question 1
What is the size of an int on most 64-bit C++ compilers?
2 bytes
4 bytes
8 bytes
1 bytes
Question 2
Which keyword is used in C++ to declare a variable that cannot be changed?
constant
const
final
immutable
Question 4
Which of the following is NOT a fundamental data type in C++?
double
class
bool
char
Question 5
Which type modifier can be used to store only positive integers?
Unsiged
signed
volatile
const
Question 7
What is the size of a bool variable in C++?
1 byte
2 bytes
4 bytes
Depends on the compiler.
Question 8
Which type qualifier is used to tell the compiler that a variable’s value may change unexpectedly?
const
static
volatile
mutable
Question 9
What type of data does std::string hold?
characters
floating point numbers
integers
Boolean Values
Question 10
Which C++ keyword is used to define a variable that retains its value across function calls?
const
static
extern
volatile
There are 20 questions to complete.