C/C MCQ Quiz Hub

C programming language MCQ Questions Set 3

Choose a topic to test your knowledge and improve your C/C skills

1. Which of the following statements are false?




2. For what values of the expression is an if-statement block not executed?




3. Which of the two operators ++ and — work for the bool data type in C++?




4. How many characters are specified in the ASCII scheme?




5. Which of the following belongs to the set of character types?




6. How do we represent a wide character of the form wchar_t?




7. In C++, what is the sign of character data type by default?




8. Is the size of character literals different in C and C++?




9. Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?




10. What constant defined in <climits> header returns the number of bits in a char?




11. The size_t integer type in C++ is?




12. Which of these expressions will return true if the input integer v is a power of two?




13. Which of these expressions will make the rightmost set bit zero in an input integer x?




14. Which of these expressions will isolate the rightmost set bit?




15. 0946, 786427373824, ‘x’ and 0X2f are _____ _____ ____ and _____ literals respectively.




16. Which of the following is not one of the sizes of the floating point types?




17. What is the range of the floating point numbers?




18. Which of three sizes of floating point types should be used when extended precision is required?




19. Which is used to indicate single precision value?




20. Which is correct with respect to the size of the data types?




21. The size of an object or a type can be determined using which operator?




22. It is guaranteed that a ____ has at least 8 bits and a ____ has at least 16 bits.




23. Implementation dependent aspects about an implementation can be found in ____




24. Size of C++ objects are expressed in terms of multiples of the size of a ____ and the size of a char is ______




25. Identify the incorrect option.




26. Which of the following will not return a value?




27. __________ have the return type void.




28. What does the following statement mean? void a;




29. Choose the incorrect option.




30. Identify the incorrect option.




31. In which type do the enumerators are stored by the compiler?




32. To which of these enumerators can be assigned?




33. What will happen when defining the enumerated type?




34. Which variable does equals in size with enum variable?




35. What does the following statement mean? int (*fp)(char*)




36.  Choose the right option. string* x, y;




37. Which one of the following is not a possible state for a pointer.




38. Which of the following is illegal?




39. The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is _______




40. Which of the following correctly declares an array?




41. What is the index number of the last element of an array with 9 elements?




42. What is the correct definition of an array?




43. Which of the following accesses the seventh element stored in array?




44. Which of the following gives the memory address of the first element in array?




45. What is the meaning of the following declaration? int(*p[5])();




46. What is size of generic pointer in C++ (in 32-bit platform)?




47. The constants are also called as ________




48. What are the parts of the literal constants?




49. How are the constants declared?