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 (June 2023)

11 questions · answer key at the end · updated 11 Oct 2026
Q11. Match List I with List II
List IList II
A. Bezier curvesI. 3-D objects that have translational/rotational symmetry
B. B-SplinesII. Fractal geometry
C. Sweep representationsIII. Bias and tension
D. Natural objectsIV. Painting, drawing, CAD
  1. A-IV, B-I, C-III, D-II
  2. A-II, B-III, C-IV, D-I
  3. A-IV, B-III, C-I, D-II
  4. A-II, B-IV, C-I, D-III
Answer & explanation →
Q31. What will be the output of the following code?
#include <stdio.h>
int main() {
  int a, b, c;
  a = 0x10; b = 010;
  c = a + b;
  printf("%d", c);
  return 0;
}
  1. 20
  2. 24
  3. Garbage
  4. Error
Answer & explanation →
Q45. A three-dimensional array in C++ is declared as int A[a][b][c]. Array elements are stored in row-major order and indexing begins from 0. The address of the element A[r][s][t], in terms of the word length w of an integer, is
  1. &A[0][0][0] + w(b·c·s + c·r + t)
  2. &A[0][0][0] + w(b·c·r + c·s + t)
  3. &A[0][0][0] + w(a·b·r + c·s + t)
  4. &A[0][0][0] + w(a·b·s + c·r + t)
Answer & explanation →
Q52. What is the output of the following code?
main() {
  struct s1 { char *z; int i; struct s1 *p; };
  static struct s1 a[] = {
    {"Nagpur", 1, a+1},
    {"Raipur", 2, a+2},
    {"Kanpur", 3, a}
  };
  struct s1 *ptr = a;
  printf("%s %s %s\n", a[0].z, ptr->z, a[2].p->z);
}
  1. Nagpur Raipur Kanpur
  2. Nagpur Nagpur Nagpur
  3. Kanpur Kanpur Kanpur
  4. Error
Answer & explanation →
Q65. The Sutherland-Hodgeman method is used on
  1. Smooth curves
  2. Line segments
  3. Convex polygons
  4. Concave polygons
Answer & explanation →
Q69. What is x in the following program?
#include <stdio.h>
int main() {
  typedef int (*(*arrfptr[3])())[10];
  arrfptr x;
  return 0;
}
  1. x is a pointer
  2. x is an array of three pointers
  3. x is an array of three function pointers
  4. Error in x declaration
Answer & explanation →
Q74. How will you free the memory allocated by the following program?
#include <stdio.h>
#include <stdlib.h>
#define MAXROW 3
#define MAXCOL 4
int main() {
  int **p, i, j;
  p = (int **) malloc(MAXROW * sizeof(int*));
  return 0;
}
  1. memfree(int p);
  2. dealloc(p);
  3. malloc(p, 0);
  4. free(p);
Answer & explanation →
Q77. The clipping process in computer graphics is used for
  1. Adding graphics
  2. Copying
  3. Zooming
  4. Removing objects and lines (outside the window)
Answer & explanation →
Q79. Consider the rectangle with vertices (0, 0), (0, 2), (3, 0), (3, 2). It is scaled by 2 along the x-axis and 3 along the y-axis. The new coordinates of the rectangle are
  1. (0,0), (6,0), (0,4), (6,4)
  2. (0,0), (6,0), (0,4), (3,2)
  3. (0,0), (6,0), (0,6), (6,6)
  4. (0,0), (4,0), (0,6), (4,6)
Answer & explanation →
Q80. Which of the following 2-D transformations is used to resize a 2-dimensional object?
  1. Translation
  2. Rotation
  3. Scaling
  4. Shearing
Answer & explanation →
Q83. What is the output of the following code?
main() {
  static float a[] = {13.24, 1.5, 4.5, 5.4, 3.5};
  float *j, *k;
  j = a;
  k = a + 4;
  j = j * 2;
  k = k / 2;
  printf("%f %f", *j, *k);
}
  1. 13.25, 4.5
  2. 1.5, 3.5
  3. 13.24, 1.5, 4.5, 5.4, 3.5
  4. Illegal use of pointer in main function
Answer & explanation →

Answer key

  1. 11 – C
  2. 31 – B
  3. 45 – B
  4. 52 – B
  5. 65 – C
  6. 69 – C
  7. 74 – D
  8. 77 – D
  9. 79 – C
  10. 80 – C
  11. 83 – D