CommerceVariables And Data Types In C Plus Plus MCQs
Practice Variables And Data Types In C Plus Plus MCQs for competitive exams.
Variables And Data Types In C Plus Plus MCQs
Practice questions from this topic.
What is the size of a 'char' data type in C++?
- A. 2 bytes
- B. 4 bytes
- C. 1 byte
- D. 8 bytes
Correct Answer: C
What is the maximum value that can be stored in an 'int' data type in C++?
- A. 32767
- B. 2147483647
- C. 65535
- D. 4294967295
Correct Answer: B
Which of the following is not a primitive data type in C++?
- A. bool
- B. char
- C. string
- D. float
Correct Answer: C
What is the data type of the variable 'x' in the following declaration: double x = 3.14;?
- A. int
- B. double
- C. float
- D. char
Correct Answer: B
Which of the following is a valid variable name in C++?
- A. myVariable
- B. 123variable
- C. variable&
- D. float
Correct Answer: A
What is the correct keyword to declare a variable in C++?
- A. var
- B. variable
- C. int
- D. declare
Correct Answer: C