Vidyalelo
C++ Programming · all questions

Variables and Data Types in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

123

Questions

2/7

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following code: cout << (5 != 2); in C++?

Select an option to see the answer and solution.

What is the size of a 'long double' data type in C++?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the correct way to represent octal values in C++?

Select an option to see the answer and solution.

What does the 'volatile' keyword do in C++?

Select an option to see the answer and solution.

What is the result of the following expression in C++: 7 % 3?

Select an option to see the answer and solution.

What is the correct way to declare a pointer to an integer in C++?

Select an option to see the answer and solution.

What is the data type of the expression: 5.2f in C++?

Select an option to see the answer and solution.

What is the output of the following code: `cout << (true || false);` in C++?

Select an option to see the answer and solution.

What is the range of values for a 'signed char' data type in C++?

Select an option to see the answer and solution.

What is the size of the 'bool' data type in C++?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the result of the expression: 10 / 3 in C++?

Select an option to see the answer and solution.

What is the correct way to declare a constant variable named 'PI' with a value of 3.14159 in C++?

Select an option to see the answer and solution.

Which keyword is used to define a constant in C++?

Select an option to see the answer and solution.

What is the data type of the expression: 3.14f in C++?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What is the output of the following code: cout << (7 >= 7); in C++?

Select an option to see the answer and solution.

What is the data type of the expression: sizeof('A') in C++?

Select an option to see the answer and solution.

What is the result of the expression: 5.0 + 3 in C++?

Select an option to see the answer and solution.