UGC NET COMPUTER SCIENCE SOLVED PAPERS 2014-16 - UGC NET Computer Science Paper 2 August 2016

11. Given i= 0, j = 1, k = – 1 x = 0.5, y = 0.0 What is the output of given ‘C’ expression ? x * 3 & & 3 || j | k

  • Option : C
  • Explanation :
    According to given data:
    x * 3 && 3 || j | k
    = 1.5 && 3 || j | k
    = 1 || j |k
    = 1
    So, option (C) is correct.
Cancel reply
Cancel reply

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

  • Option : B
  • Explanation :
    int * f [ ] ( ); is an array of functions returning pointers to integers. For more information on pointers declaration Refer:How to declare a pointer to a function? So, option (B) is correct.
Cancel reply
Cancel reply

13. If a function is friend of a class, which one of the following is wrong?

  • Option : C
  • Explanation :
    Friend of the class can be member of some other class but Friend functions are not the members of a particular class. For more information on Friend function Refer:Friend class and function in C++ Option (C) is correct.
Cancel reply
Cancel reply

14. In C++, polymorphism requires:

  • Option : D
  • Explanation :
    Basically polymorphism means having many forms. In C++, polymorphism requires Inheritance, Virtual functions and references, because polymorphism occurs when there is a hierarchy of classes and they are related by inheritance which include virtual functions and references. So, option (D) is correct.
Cancel reply
Cancel reply

15. A function template in C++ provides _____ level of generalization.

  • Option : C
  • Explanation :
    A function template in C++ provides 2 level of generalization. For more information Refer:Templates in C++ Option (C) is correct.
Cancel reply
Cancel reply