- Type
- Quiz
- Course
- CS201 Introduction to Programming
- Size
- PDF 444 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from page 1 of 1. Download the file for all 1 page.
- The stream-insertion operator >> and the stream-extraction operator is<<.
Answer: False
- It is possible to return on object from function using this pointer.
Answer: True
- A variable which is defined inside a function is called
Answer: None of the given option
- When new operator is overloaded at global level then corresponding built-new operator will also be visible to whole of the program
Answer: False
- Which of the following syntax is best used to delete an array of 5 objects named string allocated using new operator.
Answer: delete[]string;
Q6. What will the output of following statement?
( cout<<setfill (0) << setw (7) << 128;
Answer: 000128
- With user data type variables (objects) self-assignment can produce
Answer: Logical error
- In c++ operators, which of the following operator cannot be overloaded
Answer: ?:
- Overloaded member operator function is always called by …….
Answer: object
- Which of the following is the correct definition of streams? Ans. it is an ordered sequence of bytes
- The life time of the static data member of a class is the life time of the…….
Answer: program
- What is meant by the following statement? String str[5] = {String(“programming”), string (CS201)};
Answer: Parameterized constructor will be called for all objects of array
Q13. What is the difference between cout and cerr?
Answer: Destructor is called first before deallocating memory
Q14. What is the sequence of event (s) when deallocating memory of an object using delete operator?
Answer: Destructor is called first before deallocating memory
- When a variable is defined as static in a lass then ………..
Answer: only one copy is created for all objects of this class
- Which of the following syntax is best used to delete an array of 5 objects named string allocated using operator.
Answer: deelte[]string;
- Below is given a code snippet ( Char name [50]; cin>> name; cout << name; ) Now if use enters the name, for example “sohail Aslam” than what will be the output of the code?
Answer: Sohail Aslam
Q18. What is the purpose of endl stream manipulator?
Answer: flush the stream
- When the compiler overloads the assignment (=) operator by default then
Answer: class members are not assigned properly
- Let suppose a= b = c In such situation, it is necessary to return a reference of an object from assignment operator function.
True
- Ostream is a ……………….. operator.
Answer: Standalone
- The endl and flush are …………………
Answer: Manipulators
Q23. Which one of the following is the declaration of overloaded Pre-increment operator implemented as member function?
Answer: Class-name Operator ++();
- For the joining of two strings in string class, we may use ‘+’ operator, can we use ‘-‘ operator the same way for subtracting strings
Answer: Yes
- Overloaded delete operator function takes parameter of vaid pointer and returns.
Answer: Void Pointer
- When an array of object is created dynamically then there is no way to provide parameterized constructors for array of objects.
Answer: True
- Df
28.
Related CS201 files
All CS201 files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.