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

B If I would have realised

C Had I had realised

D When I 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 always return value of same data type.

C Overloaded functions can accept same number of arguments.

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

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

A Member function of class

B Member function of structure

C Both B and C

D main()

Q5: Which of the following statement is correct?

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

B The order of the default argument will be random.

C The order of the default argument will be alternate.

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 242

B The program will report error on compilation.

C 237

D 240

E 35

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

B a = 20 b = 40

C a = 20 b = Garbage

D a = Garbage b = 40

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 report compile time error.

D The program will print the output 10 20.

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 30

B 10

C 20

D 40

E Compilation fails.