Skip to main content

Variables And Data Types In C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Variables And Data Types In C Plus Plus — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

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

Question 2 of 40
★ FPSC ★ PPSC

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

Question 3 of 40
★ FPSC ★ PPSC

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

Question 4 of 40
★ FPSC ★ PPSC

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

Question 5 of 40
★ FPSC ★ PPSC

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

Question 6 of 40
★ FPSC ★ PPSC

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

Question 7 of 40
★ FPSC ★ PPSC

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

Question 8 of 40
★ FPSC ★ PPSC

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

Question 9 of 40
★ FPSC ★ PPSC

What is the result of the following expression in C++: 5 / 2?

Question 10 of 40
★ FPSC ★ PPSC

Which operator is used to find the size of a data type in C++?

Question 11 of 40
★ FPSC ★ PPSC

What is the correct way to declare a constant in C++?

Question 12 of 40
★ FPSC ★ PPSC

What will be the output of the following code: cout << (true && false); in C++?

Question 13 of 40
★ FPSC ★ PPSC

What is the correct syntax to declare and initialize a variable 'age' of type 'int' with a value of 25 in C++?

Question 14 of 40
★ FPSC ★ PPSC

What is the range of values for a 'short int' data type in C++?

Question 15 of 40
★ FPSC ★ PPSC

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

Question 16 of 40
★ FPSC ★ PPSC

Which of the following is an example of a floating-point data type in C++?

Question 17 of 40
★ FPSC ★ PPSC

What is the correct data type for storing a single character in C++?

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following code: cout << sizeof(char); in C++?

Question 19 of 40
★ FPSC ★ PPSC

Which of the following is a valid way to initialize a variable in C++?

Question 20 of 40
★ FPSC ★ PPSC

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

Question 21 of 40
★ FPSC ★ PPSC

Which of the following is the correct way to declare a constant 'PI' with a value of 3.14159 in C++?

Question 22 of 40
★ FPSC ★ PPSC

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

Question 23 of 40
★ FPSC ★ PPSC

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

Question 24 of 40
★ FPSC ★ PPSC

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

Question 25 of 40
★ FPSC ★ PPSC

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

Question 26 of 40
★ FPSC ★ PPSC

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

Question 27 of 40
★ FPSC ★ PPSC

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

Question 28 of 40
★ FPSC ★ PPSC

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

Question 29 of 40
★ FPSC ★ PPSC

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

Question 30 of 40
★ FPSC ★ PPSC

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

Question 31 of 40
★ FPSC ★ PPSC

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

Question 32 of 40
★ FPSC ★ PPSC

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

Question 33 of 40
★ FPSC ★ PPSC

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

Question 34 of 40
★ FPSC ★ PPSC

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

Question 35 of 40
★ FPSC ★ PPSC

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

Question 36 of 40
★ FPSC ★ PPSC

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

Question 37 of 40
★ FPSC ★ PPSC

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

Question 38 of 40
★ FPSC ★ PPSC

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

Question 39 of 40
★ FPSC ★ PPSC

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

Question 40 of 40
★ FPSC ★ PPSC

What is the range of values for an 'unsigned long int' data type in C++?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →