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 Had I had realised

E No correction required

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 different number and different type of arguments.

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

C Overloaded functions can accept same number 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 class

B Both B and C

C main()

D Member function of structure

Q5: Which of the following statement is correct?

A The order of the default argument will be alternate.

B The order of the default argument will be random.

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

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

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 The program will report error on compilation.

B 35

C 237

D 242

E 240

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 -6

B 6

C -8

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 = Garbage

B a = 20 b = 40

C a = Garbage b = 40

D a = 20 b = 30

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 20.

B The program will print the output 10 0.

C The program will print the output 10 garbage.

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 10

B 30

C 20

D 40

E Compilation fails.