UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Unit 3: Programming Languages and Computer Graphics PYQ (June 2023)
Q11. Match List I with List II
| List I | List II |
|---|---|
| A. Bezier curves | I. 3-D objects that have translational/rotational symmetry |
| B. B-Splines | II. Fractal geometry |
| C. Sweep representations | III. Bias and tension |
| D. Natural objects | IV. Painting, drawing, CAD |
- A-IV, B-I, C-III, D-II
- A-II, B-III, C-IV, D-I
- A-IV, B-III, C-I, D-II
- A-II, B-IV, C-I, D-III
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;
}- 20
- 24
- Garbage
- Error
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
- &A[0][0][0] + w(b·c·s + c·r + t)
- &A[0][0][0] + w(b·c·r + c·s + t)
- &A[0][0][0] + w(a·b·r + c·s + t)
- &A[0][0][0] + w(a·b·s + c·r + t)
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);
}- Nagpur Raipur Kanpur
- Nagpur Nagpur Nagpur
- Kanpur Kanpur Kanpur
- Error
Q65. The Sutherland-Hodgeman method is used on
- Smooth curves
- Line segments
- Convex polygons
- Concave polygons
Q69. What is x in the following program?
#include <stdio.h>
int main() {
typedef int (*(*arrfptr[3])())[10];
arrfptr x;
return 0;
}- x is a pointer
- x is an array of three pointers
- x is an array of three function pointers
- Error in x declaration
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;
}- memfree(int p);
- dealloc(p);
- malloc(p, 0);
- free(p);
Q77. The clipping process in computer graphics is used for
- Adding graphics
- Copying
- Zooming
- Removing objects and lines (outside the window)
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
- (0,0), (6,0), (0,4), (6,4)
- (0,0), (6,0), (0,4), (3,2)
- (0,0), (6,0), (0,6), (6,6)
- (0,0), (4,0), (0,6), (4,6)
Q80. Which of the following 2-D transformations is used to resize a 2-dimensional object?
- Translation
- Rotation
- Scaling
- Shearing
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);
}- 13.25, 4.5
- 1.5, 3.5
- 13.24, 1.5, 4.5, 5.4, 3.5
- Illegal use of pointer in main function