June 2015 - Paper 2

11:  
What is the output of the following program ?
(Assume that the appropriate preprocessor directives are included and there is no syntax error)
main ( ) 
           {    char S[ ] = "ABCDEFGH";
                 printf ("%C",* (& S[3]));
                 printf ("%s", S + 4);
                 printf ("%u", S);
            /* Base address of S is 1000 */
            }
A.

(1) ABCDEFGH1000

B.

CDEFGH1000

C.

DDEFGHH1000

D.

DEFGH1000

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

naga mani said: (3:46pm on Monday 29th June 2015)
answer D: DEFGH1000

Write your comments here:



12:  

Which of the following, in C++, is inherited in a derived class from base class ?

A.

constructor

B.

destructor

C.

data members

D.

virtual methods

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



13:  
Given that x = 7.5, j = -1.0, n = 1.0, m = 2.0
the value of - - x + j = = x > n >= m is :
A.

0

B.

1

C.

2

D.

3

 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:



14:  

Which of the following is incorrect in C++ ?

A.

When we write overloaded function we must code the function for each usage.

B.

When we write function template we code the function only once.

C.

It is difficult to debug macros

D.

Templates are more efficient than macros

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



15:  
When the inheritance is private, the private methods in base class are in the ----------- derived class (in C++).
A.

inaccessible

B.

accessible

C.

protected

D.

public

 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here: