Commerce

Variables 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++?

  1. A. 2 bytes
  2. B. 4 bytes
  3. C. 1 byte
  4. D. 8 bytes
Report Error

What is the maximum value that can be stored in an 'int' data type in C++?

  1. A. 32767
  2. B. 2147483647
  3. C. 65535
  4. D. 4294967295
Report Error

Which of the following is not a primitive data type in C++?

  1. A. bool
  2. B. char
  3. C. string
  4. D. float
Report Error

What is the data type of the variable 'x' in the following declaration: double x = 3.14;?

  1. A. int
  2. B. double
  3. C. float
  4. D. char
Report Error

Which of the following is a valid variable name in C++?

  1. A. myVariable
  2. B. 123variable
  3. C. variable&
  4. D. float
Report Error

What is the correct keyword to declare a variable in C++?

  1. A. var
  2. B. variable
  3. C. int
  4. D. declare
Report Error