Page 146 - C++
P. 146

MODEL TEST PAPER VI




              Time: 3 Hrs.                                                                 Max. Marks: 70



              1. (a)  Is it possible to do function overloading with different return types?            [2]
                (b)  Name the header files in which the following functions belongs to:
                    random() read() isalpha() tolower()                                                 [2]
                (c)  What is the output of the following program?                                       [2]
                   void fun1(int *x)
                    {
                    x=new int;
                    *x=12;
                    }
                    int main()
                    {
                    int v=20;
                    fun1(&v);
                    cout<<v;
                    }
                (d)  Find the syntax error(s), if any, in the following program:                        [2]
                   #include (iostream.h)
                    void main( )
                    {
                    int X, Y;
                    cin >> X;
                    for (Y = 0; y < 10, Y++)
                    If X == Y
                    cout << Y+X;
                    else
                    cout >> Y;
                    }
                (e)  What is the output of the following program:                                       [3]
                    #include<iostream.h>
                    #include<conio.h>
                    #include<string.h>
                    class state
                    {
                    char *statename;
                    int size;
                    public:
                    state()
                    {
                    size=0;
   141   142   143   144   145   146   147   148   149   150   151