This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1What is the difference between delete and delete[] in C++?
Option C
In C++, delete and delete[] are used to free dynamically allocated memory, but they serve different purposes.
The delete keyword is used when a single object has been allocated using new. On the other hand, delete[] is used when an array of objects has been allocated using new[].
Q: 2To implement graphic operation in C++, which header file is needed?
Option A
In C++, graphics operations such as drawing lines, circles, rectangles, and displaying graphics on the screen were traditionally done using the BGI (Borland Graphics Interface) library. For this purpose, the header file graphics.h is used.
Q: 3The statement cout<<hex<<15; prints?
Option C
In C++, hex is a formatting manipulator defined in the <iostream> header file. The manipulator hex tells cout to display numbers in hexadecimal format. The number 15 in hexadecimal is represented as f.
Q: 4What does STL stand for?
Option B
STL stands for Standard Template Library. It is a powerful collection of predefined, generic classes and functions. STL uses the concept of templates, which allows the same code to work with different data types.
It mainly includes containers such as vector, list, and map for storing data, algorithms such as sort and find for processing data, and iterators for traversing through containers.
STL helps programmers write efficient, reusable, and well-structured code, making program development faster and easier.
Q: 5A set of libraries that provides programmatically access to some kind of graphics 2D function is
Option A
A graphics package is a set of libraries that provides programming access to 2D graphics functions such as drawing lines, circles, shapes, displaying images, and creating simple visual elements. These libraries allow programmers to write code that can display graphics on the screen.
Graphics Package is the right term for a set of libraries offering programmatic 2D graphics functions.
You have reached the end of this topic. Continue learning with the next topic below.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.