🧪 C/C MCQ Quiz Hub

C Multiple Choice Questions Set-1

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

If the class name is X, what is the type of its “this” pointer (in a nonstatic, non-const member function)?





✅ Correct Answer: 1

Which classes allow primitive types to be accessed as objects?





✅ Correct Answer: 2

When is std::bad_alloc exception thrown?





✅ Correct Answer: 4

Which one of the following is not a fundamental data type in C++





✅ Correct Answer: 1

Which of the following is a valid destructor of the class name “Country”





✅ Correct Answer: 2

Which of the following correctly describes C++ language?





✅ Correct Answer: 4

Which of the following keyword supports dynamic method resolution?





✅ Correct Answer: 1

Which of the following is the most preferred way of throwing and handling exceptions?





✅ Correct Answer: 2

Which of the following is not true about preprocessor directives





✅ Correct Answer: 1

What’s wrong? while( (i < 10) && (i > 24))





✅ Correct Answer: 4

A continue statement causes execution to skip to





✅ Correct Answer: 3

What’s wrong? (x = 4 && y = 5) ? (a = 5) ; (b = 6)





✅ Correct Answer: 4

What’s wrong? for (int k = 2, k <=12, k++)





✅ Correct Answer: 2

Which of the following is not recommended in a header file?





✅ Correct Answer: 4

Which of the STL containers store the elements contiguously (in adjacent memory locations)?





✅ Correct Answer: 3

Which of the following is not a standard exception built in C++.





✅ Correct Answer: 1

What does STL stand for?#





✅ Correct Answer: 1

What is the difference between overloaded functions and overridden functions?





✅ Correct Answer: 2

Which one of the following is not a valid reserved keyword in C++





✅ Correct Answer: 2

Each pass through a loop is called a/an





✅ Correct Answer: 3

Which of the following is true about const member functions?





✅ Correct Answer: 2

Which of the following relationship is known as inheritancerelationship?





✅ Correct Answer: 1

If class A is friend of class B and if class B is friend of class C, which of the following is true?





✅ Correct Answer: 2

direct access file is:





✅ Correct Answer: 3

Which of the following is not a component of file system





✅ Correct Answer: 3

Seek time is





✅ Correct Answer: 4

Prime area’ in context of file system is defined as





✅ Correct Answer: 2

In mulit-list organization





✅ Correct Answer: 2

Which of the following is/are advantages of cellular partitioned structure





✅ Correct Answer: 1

*ptr++ is equivalenet to





✅ Correct Answer: 3

The conditional compilation





✅ Correct Answer: 4

Originally ‘C’ was developed as





✅ Correct Answer: 3

An inverted file





✅ Correct Answer: 2

Which of the following is not a file operation:





✅ Correct Answer: 1

Latency time is





✅ Correct Answer: 4

The two types of file structure existing in VSAM file are





✅ Correct Answer: 3

How many copies of a class static member are shared between objects of the class?





✅ Correct Answer: 3

Which looping process checks the test condition at the end of the loop?





✅ Correct Answer: 1

The default access level assigned to members of a class is _________





✅ Correct Answer: 3

Which of the following correctly describes the meaning of‘namespace’ feature in C++?





✅ Correct Answer: 1

Which of the following correctly describes the meaning of ‘namespace’ feature in C++?





✅ Correct Answer: 4

Which of the following language is not supported by C++?





✅ Correct Answer: 4

class derived: public base1, public base2 { } is an example of





✅ Correct Answer: 2

Which of the following languages is a subset of C++ language?





✅ Correct Answer: 4

How do we declare an ‘interface’ class?





✅ Correct Answer: 1

How do we declare an abstract class?





✅ Correct Answer: 1

Which of the following is not an advantage of secondary memory





✅ Correct Answer: 1

What happens when a pointer is deleted twice?





✅ Correct Answer: 3

Which of the following language feature is not an access specifier in C++?





✅ Correct Answer: 4

Expression C=i++ causes





✅ Correct Answer: 4