image not found

Oops! That page can't be found.


Directions to Solve

Which of phrases given below each sentence should replace the phrase printed in bold type to make the grammatically correct? If the sentence is correct as it is, mark 'E' as the answer.

Q1: The long or short of it is that I do not want to deal with that new firm.

A No correction required

B The long and short of it

C The long and short for it

D The shot and long for it

E The long or short for it

Q2: Which of the following statements are correct?

A Constructor and destructor functions are not called at all as they are always inline.

B Destructor is always called explicitly.

C Constructor is always called explicitly.

D Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.

Q3: How many times a constructor is called in the life-time of an object?

A Twice

B Only once

C Depends on the way of creation of object

D Thrice

Q4: Which of the following gets called when an object is being created?

A virtual function

B destructor

C constructor

D main

Q5: To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A delete

B destructor

C delete[]

D free[]

E kill[]

Q6: Which of the following statement is correct about constructors?

A A constructor has a void return type.

B A constructor has no return type.

C A constructor cannot contain a function call.

D A constructor has a return type.

Q7: Which of the following statement is correct whenever an object goes out of scope?

A The default constructor of the object is called.

B None of the above.

C The parameterized destructor is called.

D The default destructor of the object is called.

Q8: What will be the output of the following program?
#include<iostream.h> 
class AptitudeCrack
{
    int x; 
    public:
    AptitudeCrack(int xx, float yy)
    {
        cout<< char(yy);
    } 
}; 
int main()
{
    AptitudeCrack *p = new AptitudeCrack(35, 99.50f);
    return 0; 
}

A Garbage value

B 99

C ASCII value of 99

D 99.50

Q9: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class AptitudeCrack
{
    public:
    AptitudeCrack()
    {
        cout<< 'India';
    }
    ~AptitudeCrack()
    {
        cout<< 'Aptitude';
    }
};
int main()
{
    AptitudeCrack objAptitude;
    return 0; 
}

A The program will print the output India.

B The program will print the output Aptitude.

C The program will print the output AptitudeCrack.

D The program will report compile time error.

Q10: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class Aptitude
{
      int x; 
    public:
      Aptitude();
     ~Aptitude();
      void Show() const;
};
Aptitude::Aptitude()
{
    x = 25;
}
void Aptitude::Show() const
{
    cout<< x;
}
int main()
{
    Aptitude objB;
    objB.Show();
    return 0; 
}

A The program will print the output Garbage-value.

B The program will print the output 25.

C The program will report runtime error.

D The program will report compile time error.