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: Had I realised how close I was to the edge of the valley, I would not have carried the bags there.

A If I would have realised

B Had I been realised

C When I realised

D No correction required

E Had I had realised

Q2: Is it true that a function may have several declarations, but only one definition?

A No

B Yes

Q3: Which of the following statement is correct?

A Overloaded functions can accept only same number and same type of arguments.

B Overloaded functions can accept same number of arguments.

C Overloaded functions can accept only different number and different type of arguments.

D Overloaded functions always return value of same data type.

Q4: Which of the following function / types of function cannot have default parameters?

A Member function of structure

B Member function of class

C Both B and C

D main()

Q5: Which of the following statement is correct?

A The order of the default argument will be random.

B The order of the default argument will be right to left.

C The order of the default argument will be alternate.

D The order of the default argument will be left to right.

Q6: What will be the output of the following program?
#include<iostream.h>
long AptitudeFunction(int x, int y = 5, float z = 5)
{
    return(++x * ++y + (int)++z);
}
int main()
{
    cout<< AptitudeFunction(20, 10); 
    return 0;
}

A 242

B 35

C 237

D 240

E The program will report error on compilation.

Q7: What will be the output of the following program?
#include<iostream.h>
int AptitudeFunction(int a, int b = 3, int c = 3)
{
    cout<< ++a * ++b * --c ; 
    return 0;
}
int main()
{
    AptitudeFunction(5, 0, 0); 
    return 0;
}

A 8

B 6

C -6

D -8

Q8: What will be the output of the following program?
#include<iostream.h> 
void MyFunction(int a, int b = 40)
{
    cout<< ' a = '<< a << ' b = ' << b << endl;
}
int main()
{
    MyFunction(20, 30);
    return 0; 
}

A a = 20 b = 40

B a = Garbage b = 40

C a = 20 b = 30

D a = 20 b = Garbage

Q9: Which of the following statement is correct about the program given below?
#include<iostream.h> 
static int b = 0; 
void DisplayData(int *x, int *y = &b)
{
    cout<< *x << ' ' << *y;
}
int main()
{
    int a = 10, b = 20 ;
    DisplayData(&a, &b);
    return 0; 
}

A The program will print the output 10 0.

B The program will print the output 10 garbage.

C The program will print the output 10 20.

D The program will report compile time error.

Q10: What will be the output of the following program?
#include<iostream.h> 
typedef void(*FunPtr)(int);
int Look(int = 10, int = 20);
void Note(int); 
int main()
{
    FunPtr ptr = Note;
    (*ptr)(30); 
    return 0;
}
int Look(int x, int y)
{
    return(x + y % 20);
}
void Note(int x)
{
    cout<< Look(x) << endl;
}

A Compilation fails.

B 40

C 30

D 10

E 20