13.1

Identify the error in the following program.

Answer

It show ambiguity error, because the compiler consider int getNumber() and float getNumber() as same function. It happened because you write objtest1.getNumber(); in the main() function

13.2

Identify the error in the following program.

Answer

Here the two functions [‘person (T1 t1, T2, t2)’ and ‘person (T2 t2, T1, t1)’] are same. So you can write one of them.

13.3

Identify the error in the following program.

Answer

There is no error in this program. It will run successfully.

13.4

Find errors, if any, in the following code segment.

Answer

First you declared T as int type data and then declared as unsigned int type. So it will show error. If you write this as,
unsigned int n = 100; [N.B must be in main() function]
and max (m, n);
then it will not show any error.
Note: Write ‘return 0;’ in the main() function.


Next Previous