July 2016 - Paper 2

11:  
Given i = 0, j = 1, k = –1
 
x = 0.5, y = 0.0
 
What is the output of the following expression in C language ?
 
x * y < i + j || k
A.

– 1

B.

0

C.

1

D.

2

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



12:  
The following statement in ‘C’
 
int (*f())[ ];
 
declares
A.

a function returning a pointer to an array of integers.

B.

a function returning an array of pointers to integers.

C.

array of functions returning pointers to integers.

D.

an illegal statement.

 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:



13:  

Which one of the following is correct, when a class grants friend status to another class ?

A.
The member functions of the class generating friendship can access the members of the friend class.
B.
All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
C.

Class friendship is reciprocal to each other.

D.

There is no such concept.

 
 

Option: B

Explanation :

Click on Discuss to view users comments.

Write your comments here:



14:  

When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the superclass.

A.

Overloads

B.

Friendships

C.

Inherits

D.

Overrides

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



15:  
What is the value returned by the function f given below when n = 100 ?
 
int f (int n)
 
{ if (n = = 0) then return n;
 
else
 
return n + f(n-2);
 
}
A.

2550

B.

2556

C.

5220

D.

5520

 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here: