Skip to content
VUBuddy

CS201 Final Term Notes by Mohsin Raza

Introduction to Programming PDF 460 KBUpdated 23 Oct 2026
Final term past paper CS201 Final Term Notes by Mohsin Raza PDF 460 KB
vubuddy.com
Type
Final term past paper
Course
CS201 Introduction to Programming
Size
PDF 460 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 460 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 30. Download the file for all 30 pages.

CS201 SUBJECTIVE QUESTION ANSWERS BY MOHSIN CHINIOTI

Q1. Identify each of the following as system software and application software.

LINUX, DISK CLEANUP, WORD PROCESSOR, WINDOWS, STUDENT INFORMATION

Answer: System software: - Linux, Disk cleanup, windows. Application software: - Word Processor, Student information

Q2. Write a program which defines three variables of type double which store three different values including decimal points, using set precision manipulators to print all these values with different numbers of digits after the decimal number.

Answer: #include Page 1 int main ()

Double x1 = 12345624.72345 Double x2 = 987654.12345 Double x3 = 1985.23456 cout << setprecision (3) << x1<< endl; cout << setprecision (4) << x2 << endl; cout << setprecision (5) << x3<< endl; Return 0 ;}

Q3. Define static variable also explain life time of static variable?

Answer: Static variable means maintaining the state of a variable. It exists and lives around even when we are outside the function. It is created and initialized only once during the lifetime of the program and therefore it will be destroyed or taken out of memory only once during the lifetime of the program.

Q4. What do you know about run time error?

Answer: Run-Time Errors

  • Occur when the program is running and tries to do something that is against the rules. Example: Accessing a non-existent variable, property, method, object, etc (e.g. a method name is misspelled)
  • Sources of these can be determined by a careful reading of the code, but unfortunately, not always.

Q5. What is limitation of the friendship between classes?

Answer: Friendship relation between classes is a one way relation that is if one class declare friend another class then the another class is the friend of first class.

Q6. what is the source and destination of cin?

Answer: For cin, the source is normally keyboard and the destination can be an ordinary variable i.e. native-data type Variables.

Q7. Write the general syntax of allocation memory dynamically to an array using new operator?

Answer: Following is the syntax:

New data_type [number_of_locations];

Q8. What is different between pointers and variable?

Answer: Normal variable contains the value of variable either int or float whereas pointer variable contains the address of another variables.

Q9. What is difference between Unary and binary operators and how they can be overloaded?

Answer: Unary operator takes one argument. a ++ is an example of unary operator Binary take two operators Page 3 +,-,* are example of binary operators Overloaded binary operator may return any type Here is general syntax of overloading Return-type operator symbol (parameters);

Q10. How many types of templates?

Answer: There are two different types of templates in C++ language i.e.’ function templates and class templates.

Q11. What will be the output of following function if we call this function by passing int 5?

Template T reciprocal (T x) {return (1/x) ;}

The output will zero as 1/5 and its .05 but conversion to int make it zero Above is prototype of template class so assume passing an int and returning an int.

All CS201 files →
CS201 Introduction to Programming All CS201 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.