- Type
- Final term past paper
- Course
- CS201 Introduction to Programming
- Size
- PDF 264 KB
- 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 1, 2, 3 of 16. Download the file for all 16 pages.
CS201 FINAL SUBJECTIVE SOLVED
(VISIT VURANK FOR MORE)
Q1. Write a declaration statement for an array of 10 elements of type float. Include an initialization statement of the first four elements to 1.0, 2.0, (2 marks)
- 0 and 4.0.
Answer: float floatArry[10] = {1.0,2.0,3.0,4.0};
Q2. Write the general syntax for the declaration of pre-increment and postincrement member operator function. (2 marks)
Answer: Classname operator ++(); ---- pre increment Classname operator ++(int) ---- post increment
Q3. Give the general syntax of class template. (2 marks)
Answer: template class myclass {
What is a truth Table?
Answer: There are some areas where the decision structures become very complicated. Sometimes, we find it difficult to evaluate a complicated logical expression. Sometimes the logic becomes extremely complicated so that even writing it as a simple syntax statement in any language. It becomes complicated to determine what will be evaluated in what way. We know the concept of truth table. The truth tables are very important. These are still a tool available for analyzing logical expressions. We will read logic design in future, which is actually to do with chips and gates. How we put these things together.
Q5. What will be the output of following code, if user input a number 123 ? (2 marks)
int input ; cin >> oct >>
input; cout << hex << input
Rational: it will take 123 as octal and print it in hex form which is 53.
Q6. What is principle of friendship in the context of functions and classes? (2 marks)
Answer: Class can declare a friend function and someone from outside the class cannot declare itself friend of a class. A friend function can access the private variables of class just like a member function
Q7. How many arguments a Unary Operator take? Can we make a binary operator as unary operator? (2 marks)
Answer: Unary operator takes only one argument like i++ or i— (Post increment or post decrement operators for integers) or ++i,--i (Pre increment or pre decrement operators for integers) ,we can not make Unary operator as binary or binary as Unary operator.
Q8. Which arithmetic operators cannot have a floating point operand? (2 marks)
Answer: Modulus operator: This operator can only be used with integer operands ONLY
Q9. What are manipulators? Give one example. (2 marks)
Answer: The manipulators are like something that can be inserted into stream, effecting a change in the behavior. For example, if we have a floating point number, say pi (л), and have written it as float pi = 3.1415926 ; Now there is need of printing the value of pi up to two decimal places i.e. 3.14. This is a formatting functionality. For this, we have a manipulator that tells about width and number of decimal points of a number being printed.
Q10. Write down piece of code that will declare a matrix of 3x3. And initialize all its locations with 0; (2 marks)
Answer: int matrix [3] [3] ; include<iostream.h>
Related CS201 files
All CS201 files →- CS201 Final Term Short Notes Set 3 Final term PDF 168 KB
- CS201 Final Term Solved MCQs by Junaid Final term PDF 1.7 MB
- CS201 Final Term Solved Papers 3 by Waqar Siddhu Final term PDF 3.5 MB
- CS201 Final Term Past Paper Fall 2008 Final term PDF 299 KB
- CS201 Highlighted Handouts by Mickey Ch Highlighted PDF 5.1 MB
- CS201 GDB Solution by Saim GDB DOCX 8 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.