image not found

Oops! That page can't be found.


Directions to Solve

In questions below, each passage consist of six sentences. The first and sixth sentence are given in the begining. The middle four sentences in each have been removed and jumbled up. These are labelled as P, Q, R and S. Find out the proper order for the four sentences.

Q1:
S1: Calcutta unlike other cities kepts its trams.
P : As a result there horrendous congestion.
Q : It was going to be the first in South Asia.
R : They run down the centre of the road
S : To ease in the city decided to build an underground railway line.
S6: The foundation stone was laid in 1972.
The Proper sequence should be:

A PRSQ

B PSQR

C SQRP

D RPSQ

Q2: What will be the output of the following program?
#include<iostream.h> 
class Number
{
    int Num; 
    public:
    Number(int x = 0)
    {
        Num = x;
    }
    void Display(void)
    {
        cout<< Num;
    }
    void Modify(); 
};
void Number::Modify()
{
    int Dec;
    Dec = Num % 13; 
    Num = Num / 13; 
    
         if(Num  > 0 ) Modify()   ; 
         if(Dec == 10) cout<< 'A' ; 
    else if(Dec == 11) cout<< 'B' ; 
    else if(Dec == 12) cout<< 'C' ; 
    else if(Dec == 13) cout<< 'D' ;
    else               cout<< Dec ;
}
int main()
{
    Number objNum(130);
    objNum.Modify();
    return 0; 
}

A 130

B A0

C B0

D 90

Q3: What will be the output of the following program?
#include<iostream.h> 
class Base
{
    int x, y; 
    public:
    Base() 
    {
        x = y = 0; 
    } 
    Base(int xx)
    {
        x = xx;
    }
    Base(int p, int q = 10)
    {
        x = p + q;
        y = q; 
    } 
    void Display(void)
    {
        cout<< x << ' ' << y << endl;
    } 
}objDefault(1, 1);

class Derived: public Base
{
    Base obj; 
    public:
    Derived(int xx, int yy): Base(xx, xx + 1)
    { }
    Derived(Base objB = objDefault)
    { } 
}; 
int main()
{
    Derived objD(5, 3);
    Derived *ptrD = new Derived(objD);
    ptrD->Display();
    delete ptrD;
    return 0; 
}

A 3 2

B 8 3

C 11 6

D 11 10

E The program will not compile successfully.

Q4: What is correct about the following program?
#include<iostream.h> 
class Base
{
    int x, y, z; 
    public: 
    Base()
    {
        x = y = z = 0;
    }
    Base(int xx, int yy = 'A', int zz = 'B')
    {
        x = xx;
        y = x + yy;
        z = x + y;
    }
    void Display(void)
    {
        cout<< x << ' ' << y << ' ' << z << endl;
    }
};
class Derived : public Base
{
    int x, y; 
    public:
    Derived(int xx = 65, int yy = 66) : Base(xx, yy)
    {
        y = xx; 
        x = yy;
    }
    void Display(void)
    {
        cout<< x << ' ' << y << ' ';
        Display(); 
    }
};
int main()
{
    Derived objD;
    objD.Display();
    return 0; 
}

A The program will report compilation error.

B The program will run successfully giving the output 66 65.

C The program will run successfully giving the output 65 66.

D The program will run successfully giving the output 66 65 65 131 196.

E The program will produce the output 66 65 infinite number of times (or till stack memory overflow).

Q5: Which of the following statement is correct about the program given below?
#include<iostream.h> 
static int Result;
class India
{
    public:
    void Change(int x = 10, int y = 20, int z = 30)
    {
        cout<< x + y + z;
    }
    void Display(int x = 40, float y = 50.00)
    {
        Result = x % x; 
        cout<< Result;
    }
};
class Aptitude
{
    int x, y; 
    public:
    void Change(int x, int y = 50)
    {
        cout<< x + y;
    }
};
class AptitudeCrack: public India, public Aptitude
{
    public:
    void Display(int x = 10, int xx = 100, int xxx = 1000)
    {
        Result = x + xx % x * x;
        cout<< Result ; 
    }
};
int main()
{
    AptitudeCrack objAptitude;
    objAptitude.India::Display(10, 20.00);
    return 0; 
}

A The program will print the output 0.

B The program will print the output 10.

C The program will print the output 30.

D The program will print the output 40.

E The program will report compile time error.

Q6: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class AptitudeCrack
{
    int x; 
    float y; 
    public:
    void AptitudeFunction(int = 0, float = 0.00f, char = 'A');
    void AptitudeFunction(float, int = 10.00, char = 'Z');
    void AptitudeFunction(char, char, char);
};
int main()
{
    AptitudeCrack objAptitude;
    objAptitude.AptitudeFunction(10 * 1.0, int(56.0)); 
    return 0;
}
void AptitudeCrack::AptitudeFunction(int xx, float yy, char zz)
{
    x = xx + int(yy);
    cout<< 'x = ' << x << endl;
}
void AptitudeCrack::AptitudeFunction(float xx, int yy, char zz)
{
    x = zz + zz;
    y = xx + yy;
    cout<< ' x = ' << x << endl;
}
void AptitudeCrack::AptitudeFunction(char xx, char yy, char zz)
{
    x = xx + yy + zz; 
    y = float(xx * 2); 
    cout<< ' x = ' << x << endl;
}

A The program will print the output x = 65.

B The program will print the output x = 66.

C The program will print the output x = 130.

D The program will print the output x = 180.

E The program will not compile successfully.

Q7: Which of the following statement is correct about the program given below?
#include<iostream.h> 
static double gDouble; 
static float  gFloat; 
static double gChar; 
static double gSum = 0; 
class BaseOne
{
    public:
    void Display(double x = 0.0, float y = 0.0, char z = 'A')
    {
        gDouble = x;
        gFloat  = y;
        gChar   = int(z);
        gSum    = gDouble + gFloat + gChar;
        cout << gSum; 
    }
};
class BaseTwo
{
    public: 
    void Display(int x = 1, float y = 0.0, char z = 'A')
    {
        gDouble = x;
        gFloat  = y;
        gChar   = int(z); 
        gSum    = gDouble + gFloat + gChar;
        cout << gSum;
    }
};
class Derived : public BaseOne, BaseTwo
{
    void Show()
    {
        cout << gSum;
    } 
}; 
int main()
{
    Derived objDev;
    objDev.BaseTwo::Display(10, 20, 'Z');
    return 0; 
}

A The program will print the output 0.

B The program will print the output 120.

C The program will report run-time error.

D The program will report compile-time error.

E The program will print the output garbage value.

Q8: What will be the output of the following program?
#include<iostream.h> 
class Base
{
    public:
    int S, A, M; 
    Base(int x, int y)
    {
        S = y - y;
        A = x + x; 
        M = x * x;
    }
    Base(int, int y = 'A', int z = 'B')
    {
        S = y;
        A = y + 1 - 1; 
        M = z - 1;
    }
    void Display(void)
    {
        cout<< S << ' ' << A << ' ' << M << endl;
    }
};
class Derived : public Base
{
    int x, y, z; 
    public:
    Derived(int xx = 65, int yy = 66, int zz = 67): Base(x)
    {
        x = xx; 
        y = yy;
        z = zz;
    }
    void Display(int n)
    {
        if(n)
            Base::Display(); 
        else
            cout<< x << ' ' << y << ' ' << z << endl; 
    }
};
int main()
{
    Derived objDev; 
    objDev.Display(-1); 
    return 0;
}

A 65 65 65

B 65 66 67

C A A A

D A B C

E The program will report compile time error.

Q9: What will be the output of the following program?
#include<iostream.h> 
class Base
{
    public:
    char S, A, M; 
    Base(char x, char y)
    {
        S = y - y;
        A = x + x; 
        M = x * x;
    }
    Base(char, char y = 'A', char z = 'B')
    {
        S = y;
        A = y + 1 - 1; 
        M = z - 1;
    }
    void Display(void)
    {
        cout<< S << ' ' << A << ' ' << M << endl;
    }
};
class Derived : public Base
{
    char x, y, z; 
    public:
    Derived(char xx = 65, char yy = 66, char zz = 65): Base(x)
    {
        x = xx; 
        y = yy;
        z = zz;
    }
    void Display(int n)
    {
        if(n)
            Base::Display(); 
        else
            cout<< x << ' ' << y << ' ' << z << endl; 
    }
};
int main()
{
    Derived objDev; 
    objDev.Display(0-1); 
    return 0;
}

A A A A

B A B A

C A B C

D Garbage Garbage Garbage

E The program will report compile time error.

Q10: What happens when we try to compile the class definition in following code snippet?
class Birds {};
class Peacock : protected Birds {};

A It will not compile because class body of Birds is not defined.

B It will not compile because class body of Peacock is not defined.

C It will not compile because a class cannot be protectedly inherited from other class.

D It will compile succesfully.