CS201 Final Term Solved Subjective Set 3 by Junaid
- Type
- Final term past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 1.4 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extension for 30 a day.
Preview text
Text from pages 2, 3, 4 of 21. Download the file for all 21 pages.
Q1. How can we overcome the issue of dangling reference in a program?
Answer: We can avoid the dangling pointer errors by initialize pointer to NULL, after de-allocating memory, so that pointer will be no longer dangling. Assigning NULL value means pointer is not pointing to any memory location. Pointers The Pointer in C is a variable that stores address of another variable. A pointer can also be used to refer to another pointer function.
Q2. // what will be output of the program below?
int main ()
int i =2;
int j =3;
int k=2*++i*j++;
cout<<k;
- What is overloading declaration for a stream extraction (>>) for an integer.
Answer: C++ is able to input and output the built-in data types using the stream extraction operator >> and the stream insertion operator <<. The stream insertion and stream extraction operators also can be overloaded to perform input and output for user-defined types like an object.
- Suppose an object of class A is declared as data member of class B.
- The constructer of which class will be called first?
- The distracter of which class will be declared first?
- A
- B
- //identify and correct error(s) in given code. while (c<=5);
sum + =c; c ++;
Answer: Logical error
- Identify each of the following as system software and application software.
Answer: LINUX, DISK CLEANUP, WORD PROCESSOR, WINDOWS, STUDENT INFORMATION
System software: - Linux, Disk cleanup, windows. Application software: - Word Processor, Student information
Q7. //what will be the output of the following code snippet?
int x=10; int &y=x; y+=5; cout<<x;
Q8. Write a function named sum which accepts an integer in the function use a static variable to add the passed to it as arguments with each function call in the end, display the sum of values passed as arguments?
int main(){
Related CS201 files
All CS201 files →- CS201 Final Term Past Papers File 3 Set 2 by Waqar Siddhu Final term PDF 4.9 MB
- CS201 Final Term Subjective Set 2 by Waqar Siddhu Final term PDF 11.9 MB
- CS201 Final Term Solved MCQs Set 3 by Junaid Final term PDF 2.5 MB
- CS201 Final Term Solved Subjective by Junaid Final term PDF 1.1 MB
- CS201 Highlighted Handouts by VU Topper RM Highlighted PDF 5.4 MB
- CS201 Quiz File Quiz PDF 95 KB
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.