Paper 1.

cs201

date = 17-sep-2022

mcqs_40

jin ma sa zyda tr 23 sa 45 lec ma sa mcqs tha

subjective

sra ka sara code tha kuch bhi question nhi tha ..... 7 long question tha 5 5 marks ka jin ma sa 3 ka code likhna the r baqi ka output and. jo short tha wo bhi same asa hi tha sirf ik malloc ka synatx btna tha 3 marks ka tha is ka ilawa sra ka sra code tha


Paper 2:

Today paper  Cs201  

40 mcq th aur mostly quiz wale repeat th

8 question th 3 short ,5long 

Long m coding wale th sb question 2 ki output btani thi aur baki ka code likhna tha long 23_45 wale chap m se hi th aur short m aik error wala question tha aik friend ship of class or general syntax user defined  th

CS201 Final Spring 2022

17th September, 2022


Q. 1

How many arguments does functions members operators functions take? And how many arguments does non-member operators functions take?


Q. 2

What will be the first argument for the overloading stream insertion (<<) operator and stream extraction (>>) operator?


Q. 3

Write the output of the following code:

void sample(int& a, int& b, int& c)

{

    a *= 2;

    b *= 3;

    c *= 4;

}

int main()

{

    int x=1, y=3, z=7;

    sample(x, y, z);

    cout<<x<<y<<z;

    return 0;

}


Q. 4

Identify and correct errors in the following code:

char *string[];

string==new[20];

loose string;


Q. 5

There are errors in the following code. Identify and briefly explain each error.

class Sample:

    {

         private:

             int year;

             int day;

             int month;

        Public:

             setMonth(int x);

             setDay(int y);

}


Q. 6

Here is a Date class:

class Date

{

    private:

        int year;

        int day;

        int month;

    public:

    Date()

    {

        day = 1;

        month = 1;

        year = 2000;

    }

};

Write a class Person, with the members char pointer name, char pointer address and an object of Date class. Also write a default constructor that should assign the members of the Person class and the Members of the Date class to a default value.


Q. 7

Decalre 5 integers, store the values given below and then use the setfill and setw to display the output like the following:

xxxxxx1000

xxxxxx1200

xxxxx20000

xxxxx30000

xxxxx60000


Q. 8

Write a program for an overloaded increment operator (++) with the functionality of both the pre increment and post increment!


Q. 9

Q. 10


Yara mjy last Waly 2 questions bhool gaye hai, any way GOOD LUCK