All mock tests are FREE till 31 December — register to save your progress
UGC NET · PAPER 2

UGC NET Paper 2 Computer Science – Unit 3: Programming Languages and Computer Graphics PYQ (December 2023)

10 questions · answer key at the end · updated 11 Oct 2026
Q9. Consider a triangle PQR with coordinates P(0,0), Q(2,2) and R(10,4). If this triangle is to be magnified to four times its size while keeping R(10,4) fixed, then the coordinates of the magnified triangle are:
  1. P(−20,−12), Q(−20,−4) and R(10,4)
  2. P(−30,−12), Q(−22,−4) and R(10,4)
  3. P(−25,−10), Q(22,−4) and R(10,4)
  4. P(30,−12), Q(−22,4) and R(10,4)
Answer & explanation →
Q10. Which of the following statements is TRUE?
  1. Virtual functions do not implement polymorphism
  2. Virtual functions do not permit calling of derived class functions using a base class pointer
  3. We can never build an object from a class containing a pure virtual function
  4. A pure virtual function can never have a body
Answer & explanation →
Q11. What is the output of the following program?
#include<stdio.h>
int main() {
  int i = 3;
  while (i--) {
    int i = 10;
    i--;
    printf("%d", i);
  }
  printf("%d", i);
}
  1. 990
  2. 9990
  3. 999-1
  4. 99-1
Answer & explanation →
Q12. The hue of a colour is related to its:
  1. Luminance
  2. Saturation
  3. Incandescence
  4. Wavelength
Answer & explanation →
Q16. What is the output of the following program?
#include <stdio.h>
#define SQR(x) (x*x)
int main() {
  int a, b = 3;
  a = SQR(b+2);
  printf("%d", a);
  return 0;
}
  1. 25
  2. 11
  3. Garbage value
  4. 24
Answer & explanation →
Q47. Consider the three points P1(1, 2, 0), P2(3, 6, 20) and P3(2, 4, 6) and a viewpoint C(0, 0, −10). Choose the correct options.
(A) P1 obscures P2 if viewed from C.
(B) P2 obscures P1 if viewed from C.
(C) P3 does not obscure P1 if viewed from C.
(D) P2 does not obscure P3 if viewed from C.
Choose the correct answer from the options given below:
  1. (A), (B) and (C) Only
  2. (A), (C) and (D) Only
  3. (B), (C) and (D) Only
  4. (A), (B) and (D) Only
Answer & explanation →
Q48. Which of the statements are CORRECT?
(A) Constructors are invoked automatically when objects are created.
(B) Constructors do not have return types, not even void, and therefore cannot return values.
(C) Constructors cannot be inherited, though a derived class can call the base class constructors.
(D) Constructors can be declared as virtual.
Choose the correct answer from the options given below:
  1. (A), (B) and (D) Only
  2. (A), (B) and (C) Only
  3. (B), (C) and (D) Only
  4. (A), (C) and (D) Only
Answer & explanation →
Q68. Match List I with List II
List IList II
(a) Bresenham(I) Hidden surface removal
(b) Cohen-Sutherland algorithm(II) Line drawing
(c) Sutherland-Hodgeman algorithm(III) Line clipping
(d) Z-Buffer algorithm(IV) Polygon clipping
  1. (a)-(III), (b)-(II), (c)-(IV), (d)-(I)
  2. (a)-(II), (b)-(III), (c)-(I), (d)-(IV)
  3. (a)-(II), (b)-(III), (c)-(IV), (d)-(I)
  4. (a)-(II), (b)-(IV), (c)-(III), (d)-(I)
Answer & explanation →
Q78. Consider the following code segment:
int arr[] = {0,1,2,3,4};
int i = 1, *ptr;
ptr = arr + 2;
Arrange the following printf statements in increasing order of their output:
(a) printf("%d", ptr[i]);
(b) printf("%d", ptr[i+1]);
(c) printf("%d", ptr[-i]);
(d) printf("%d", ptr[-i+1]);
  1. (c), (a), (b), (d)
  2. (c), (d), (a), (b)
  3. (d), (a), (b), (c)
  4. (a), (b), (d), (c)
Answer & explanation →
Q87. Statement (I): A friend function and the member functions of a friend class can directly access private and protected data.
Statement (II): A friend function can access private data through the member functions of the base class.
In the light of the above statements, choose the most appropriate answer from the options given below:
  1. Both Statement I and Statement II are correct
  2. Both Statement I and Statement II are incorrect
  3. Statement I is correct but Statement II is incorrect
  4. Statement I is incorrect but Statement II is correct
Answer & explanation →

Answer key

  1. 9 – B
  2. 10 – C
  3. 11 – C
  4. 12 – D
  5. 16 – B
  6. 47 – B
  7. 48 – B
  8. 68 – C
  9. 78 – B
  10. 87 – A