Sample Paper - CS201P
Sample Paper - CS201P
FINALTERM EXAMINATION
Fall 2022
CS201P – Introduction to Programming Practical
Time: 90 min
Marks: 40
In C++, which one of the following is used for clarity and to force the order of evaluation
in an expression?
A. []
B. {}
C. ()
D. <>
The input function which will get the input from the keyboard, takes an argument of type
_________.
A. ostream
B. istream
C. ifstream
D. instream
int main(){
int x = 2;
double eq1 = (11+x)/ (x*x*x) + 2*x*(5-x);
cout << eq1;
double eq2 = (x*x) + x*(2+2*x)/ (11+x);
cout << eq2;
}
Solution:
2.5 marks for each.
13
4
#include <iostream>
using namespace std;
class Student
{
public:
~Student()
{
cout<<"Hello";
}
Student(int x)
{
for(int i=0;i<x;i++)
cout<<"Welcome to VU"<<endl;
}
};
int main()
{
Student s1(4);
}