In the last set of MCQs, we were introduced to C++ Keywords. There, we have discussed some questions. This set of multiple choice questions focuses on the C++ Data Types.
Firstly, read all the questions and after that select the appropriate option. Moreover, each question contains four options, out of them only one option will be correct. If you fail to select the correct option, don’t worry, you can try again at the end (by refreshing the page). You can use Previous and Next button to switch to a different set of questions.
These questions focuses on different Data Types of C++ like Booleans, Character Types, Integer Types, Floating Point Types, Sizes of data types, Void type, Enumerations. So, first try to learn about data types and then attempt these question to check how much you have learned.
C++ MCQ | DATA TYPES
TEST INSTRUCTIONS: Click on options to see the answer.
In this quiz, there are total 58 questions. So, make sure to switch to the next page by clicking on next button at the end of every 10 questions. After completion of all 58 questions, click on Finish button.
Now, start attempting the quiz.
#1. Pick the odd one out
#2. Which datatype is used to represent the absence of parameters?
#3. Which type is best suited to represent the logical values?
#4. Identify the user-defined types from the following?
#5. The value 146.37 can represented using which data type?
#6. Which of the following data types CANNOT store the number 47,255?
#7. Which data type holds the integers or real numbers with 8 bytes of memory allocated?
#8. Which data type holds the alphanumerics using character encoding? (size varies)
#9. Which holds whole numbers? (4 bytes)
#10. Which of the following belongs to the set of character types?
#11. In C++, what is the sign of character data type by default?
#12. What is size of void in bytes?
#13. Which is not an integer data type?
#14. ___ refers to the process of changing the data type of the value stored in a variable.
#15. ___ data types are structure, union, class and enumeration.
#16. What is the size of wchar_t in C++?
#17. Which of the following statements are true?
int f(float)
#18. When a language has the capability to produce new data type mean, it can be called as
#19. Pick the odd one out.
#20. Is bool a fundamental data type in C++?
#21. Find the odd one out.
#22. What happens when a null pointer is converted into bool?
#23. Which of the following statements are false?
#24. For what values of the expression is an if-statement block not executed?
#25. Which of the two operators ++ and — work for the bool data type in C++?
#26. Evaluate the following.
(false && true) || false || true
#27. How many characters are specified in the ASCII scheme?
#28. Given the variables p, q are of char type and r, s, t are of int type. Select the right statement?
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);
#29. How do we represent a wide character of the form wchar_t?
#30. Is the size of character literals different in C and C++?
#31. Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?
#32. The size_t integer type in C++ is?
#33. Which of these expressions will return true if the input integer v is a power of two?
#34. What is the value of the following 8-bit integer after all statements are executed?
int x = 1;
x = x << 7;
x = x >> 7;
#35. Which of these expressions will make the rightmost set bit zero in an input integer x?
#36. Which of these expressions will isolate the rightmost set bit?
#37. 0946, 786427373824, ‘x’ and 0X2f are _____ _____ ____ and _____ literals respectively.
#38. Which of the following is not one of the sizes of the floating point types?
#39. Which of the following is a valid floating-point literal?
#40. What is the range of the floating point numbers?
#41. Which of three sizes of floating point types should be used when extended precision is required?
#42. Which is used to indicate single precision value?
#43. Which is correct with respect to the size of the data types?
#44. The size of an object or a type can be determined using which operator?
#45. It is guaranteed that a ____ has at least 8 bits and a ____ has at least 16 bits.
#46. Size of C++ objects are expressed in terms of multiples of the size of a ____ and the size of a char is _______
#47. Identify the incorrect option.
#48. Which of the following will not return a value?
#49. _______ have the return type void.
#50. What does the following statement mean?
void a;
#51. Choose the incorrect option.
#52. Identify the incorrect option.
#53. In which type do the enumerators are stored by the compiler?
#54. To which of these enumerators can be assigned?
#55. What will happen when defining the enumerated type?
#56. Which variable does equals in size with enum variable?
#57. Which is the correct syntax for defining an enumeration data type?
#58. Identify the type of variables.
typedef char* CHAR;
CHAR p,q;
Results
<< Prev- C++ MCQs : C++ Keywords
>> Next- C++ MCQ : C++ Constants
Are you curious to learn more about C++ Programming? If yes, then don’t forget to explore all the topics of C++ programming. Here, is the complete set of Multiple Choice Questions and Answers. These question sets are very helpful in preparing for Competitive Exams and University level exams.
For frontend projects, check and implements these beginner’s friendly projects :- TOP 7 PROJECTS FOR BEGINNERS TO PRACTICE HTML & CSS SKILLS
Want backlinks to your website? If yes, then follow this article and get to know in very easy way. How You Can Create High Quality Backlinks In 2021?
Learn about 404 ERROR page – EVERYTHING YOU NEED TO KNOW ABOUT 404 ERROR PAGE FOR SEO
Do practice of HTML questions :- Multiple choice questions on HTML
Do practice of C programming :- Multiple choice questions on C programming
All the answers in this set are correct. But in case, you find any typographical, grammatical or any other error in our site then kindly inform us. Don’t forget to provide the appropriate URL along with error description. So that we can easily correct it.
Thanks in advance.
For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.
Excellent short article. Articles that have significant as well as insightful content are extra enjoyable.