Preparing your form...
|Programming Languages and Computer Graphics PYQs

UGC NET Computer Science Programming Languages and Computer Graphics Previous Year Questions (PYQs)

Practise 141 Programming Languages and Computer Graphics questions asked in UGC NET Computer Science from 2018–2026. Questions cover Language design, Programming paradigms, C and C++ constructs, Java, Storage management and Web technologies. Every question is shown with its options and the correct answer, free to read.

141 PYQs2018–2026Answers includedFree

Practise Programming Languages and Computer Graphics as timed sets

Focused 10-question sets with instant scoring, explanations, and weak-area analysis.

Start practice

All 141 Programming Languages and Computer Graphics PYQs

Ordered newest exam first. Each question links back to the full paper it came from.

  1. Match List-I with List-II.

    List-IList-II
    A. Pivot point
    B. Fixed point
    C. Mirror image
    D. Distortion
    I. Reflection
    II. Shear
    III. Rotation
    IV. Scaling
    1. AA-III, B-IV, C-I, D-II
    2. BA-III, B-IV, C-II, D-I
    3. CA-IV, B-III, C-II, D-I
    4. DA-I, B-II, C-III, D-IV

    Answer: (A) A-III, B-IV, C-I, D-II

    Explanation

    Sign in to read the full explanation
  2. Arrange these C++ data types in non-decreasing order of representation length.

    A. char
    B. int
    C. float
    D. double

    1. AB, A, C, D
    2. BA, B, D, C
    3. CD, C, B, A
    4. DA, B, C, D

    Answer: (D) A, B, C, D

    Explanation

    Sign in to read the full explanation
  3. Match List-I with List-II.

    List-IList-II
    A. long signed int
    B. double
    C. long double
    D. unsigned character
    I. %lf
    II. %Lf
    III. %c
    IV. %ld
    1. AA-II, B-I, C-IV, D-III
    2. BA-IV, B-I, C-II, D-III
    3. CA-III, B-I, C-II, D-IV
    4. DA-I, B-II, C-IV, D-III

    Answer: (B) A-IV, B-I, C-II, D-III

    Explanation

    Sign in to read the full explanation
  4. What is the output of this C program?

    #include <stdio.h>
    int main() {
    int i;
    for (i = 0; i++ < 10;)
    printf("%d", i++);
    return 0;
    }

    1. A0123456789
    2. B12345678
    3. C13579
    4. D2468

    Answer: (C) 13579

    Explanation

    Sign in to read the full explanation
  5. The number of pixel columns divided by the number of scan lines displayed by a system is called:

    1. APixmap
    2. BBitmap
    3. CAspect ratio
    4. DDepth

    Answer: (C) Aspect ratio

    Explanation

    Sign in to read the full explanation
  6. Which statements about C++ constructors are correct?

    A. They have the same name as the class.
    B. They can return values.
    C. They are called automatically when an object is created.
    D. They can be overloaded.
    E. They can be inherited.

    1. AA, B, C and D only
    2. BA, C and D only
    3. CB, C and D only
    4. DC, D and E only

    Answer: (B) A, C and D only

    Explanation

    Sign in to read the full explanation
  7. What is z after this C code executes?

    x = 16;
    y = 4;
    z = x >> y;

    1. A5
    2. B4
    3. C2
    4. D1

    Answer: (D) 1

    Explanation

    Sign in to read the full explanation
  8. The shown transformation is a reflection about which axis?

    Original and reflected triangle positions about the vertical axis.

    Original and reflected triangle positions about the vertical axis.

    1. AA and D only
    2. BA and C only
    3. CB and C only
    4. DB and D only

    Answer: (C) B and C only

    Explanation

    Sign in to read the full explanation
  9. Assertion (A): The control points have only local control over the shape of the B-Splines.
    Reason (R): Bezier curves do have local control.

    1. ABoth A and R are correct and R is the correct explanation of A
    2. BBoth A and R are correct but R is NOT the correct explanation of A
    3. CA is correct but R is not correct
    4. DA is not correct but R is correct

    Answer: (C) A is correct but R is not correct

    Explanation

    Sign in to read the full explanation
  10. Which of the following statements are true?
    A. Painters' algorithm is also called depth sort algorithm.
    B. Gourad shading is an interpolating shading method.
    C. Gourad shading is an averaging shading method.
    D. The Z-buffer algorithm finds the largest depth value Z.

    1. AA, B Only
    2. BB, C Only
    3. CC, D Only
    4. DA, D Only

    Answer: (A) A, B Only

    Explanation

    Sign in to read the full explanation
  11. Match List-I (C++ file mode parameters) with List-II.

    LIST-I (File mode parameter)LIST-II (Meaning)
    A. ios::ateI. Go to end of file on opening
    B. ios::inII. Open fails if the file already exists
    C. ios::nocreateIII. Open file for reading only
    D. ios::noreplaceIV. Open fails if the file does not exist
    1. AA-III, B-IV, C-II, D-I
    2. BA-I, B-III, C-II, D-IV
    3. CA-II, B-IV, C-I, D-III
    4. DA-I, B-III, C-IV, D-II

    Answer: (D) A-I, B-III, C-IV, D-II

    Explanation

    Sign in to read the full explanation
  12. Which of the following statements are true?
    A. The ++ operator can be overloaded to perform decrementation of a variable.
    B. It is necessary that a constructor in a class should always be public.
    C. Size of an object is equal to the sum of sizes of data members and member functions within the class.
    D. A static data member is useful when all objects of a class are to share a common item of information.
    E. The this pointer always contains the address of the object using which the member function is being called.

    1. AA, B, C Only
    2. BB, C, E Only
    3. CA, D, E Only
    4. DB, D, E Only

    Answer: (C) A, D, E Only

    Explanation

    Sign in to read the full explanation
  13. Assertion (A): We can build an object from a class containing a pure virtual function.
    Reason (R): A class containing a pure virtual function is called an abstract class.

    1. ABoth A and R are correct and R is the correct explanation of A
    2. BBoth A and R are correct but R is NOT the correct explanation of A
    3. CA is correct but R is not correct
    4. DA is not correct but R is correct

    Answer: (D) A is not correct but R is correct

    Explanation

    Sign in to read the full explanation
  14. For implicit type conversion, arrange the following from a lower size type to a higher size type.

    A. double
    B. unsigned long int
    C. unsigned int
    D. long double
    E. long int

    1. AE, C, B, A, D
    2. BC, B, E, D, A
    3. CE, C, A, B, D
    4. DC, E, B, A, D

    Answer: (D) C, E, B, A, D

    Explanation

    Sign in to read the full explanation
  15. Match List-I (Quadric surfaces) with List-II (Equations).

    List-I (Quadric Surface)List-II (Equation)
    A. One-sheeted hyperboloidI. x²/a² + y²/b² = cz
    B. Two-sheeted hyperboloidII. x²/a² + y²/b² - z²/c² = 1
    C. Elliptic paraboloidIII. x²/a² - y²/b² = cz
    D. Hyperbolic paraboloidIV. z²/c² - x²/a² - y²/b² = 1
    1. AA-I, B-II, C-III, D-IV
    2. BA-II, B-III, C-IV, D-I
    3. CA-II, B-IV, C-I, D-III
    4. DA-IV, B-II, C-I, D-III

    Answer: (C) A-II, B-IV, C-I, D-III

    Explanation

    Sign in to read the full explanation
  16. Which of the following is not true about constructors?

    1. AWhen an object is created and initialized at the same time, a copy constructor gets called
    2. BThey do not have return types, not even void
    3. CThey can be virtual
    4. DThey cannot be inherited, though a derived class can call the base class constructor

    Answer: (C) They can be virtual

    Explanation

    Sign in to read the full explanation
  17. A normalized matrix maps a 3D window specified by coordinates (1, 1, 1) and (4, 5, 6) onto a viewport specified by coordinates (2, 4, 2) and (8, 10, 8). Which of the following matrices correctly represents this transformation?

    1. A2 0 0 0
      0 3/2 0 5/2
      0 0 6/5 4/5
      0 0 0 1
    2. B2 0 0 0
      0 3 0 5
      0 0 6 4
      0 0 0 1
    3. C2 1 0 1
      1 3 4 5
      0 0 2 4
      0 1 0 0
    4. D1 0 0 1
      2 3 0 5
      1 0 4 5
      0 0 0 1

    Answer: (A) 2 0 0 0
    0 3/2 0 5/2
    0 0 6/5 4/5
    0 0 0 1

    Explanation

    Sign in to read the full explanation
  18. Arrange the following applet life cycle methods in sequence.

    A. start()
    B. paint()
    C. init()
    D. stop()

    1. AA, B, C, D
    2. BC, A, B, D
    3. CA, C, B, D
    4. DB, A, C, D

    Answer: (B) C, A, B, D

    Explanation

    Sign in to read the full explanation
  19. What is printed by this C program?

    int x = 128, y = 110;
    do {
      if (x > y) x = x - y;
      else y = y - x;
    } while (x != y);
    printf("%d", x);
    
    1. A18
    2. B2
    3. C92
    4. D74

    Answer: (B) 2

    Explanation

    Sign in to read the full explanation
  20. Which technique is used for clipping?

    1. AStack-based seed
    2. BScan-line seed
    3. CSutherland-Cohen
    4. DInverse scaling

    Answer: (C) Sutherland-Cohen

    Explanation

    Sign in to read the full explanation
  21. What is printed by this C program?

    int i, j;
    for (i = 1; i < 5; i += 2)
      for (j = 1; j < i; j += 2)
        printf("%d", j);
    
    1. A1
    2. B1 2
    3. C1 3
    4. D1 1 3

    Answer: (A) 1

    Explanation

    Sign in to read the full explanation
  22. Which pointer expression refers to the array element ar[m][n][o]?

    1. A((*(ar) + m + n) + o)
    2. B(((*ar + m) + n) + o)
    3. C(((ar + m) + n) + o)
    4. D((*(ar + m) + n) + o)

    Answer: (D) ((*(ar + m) + n) + o)

    Explanation

    Sign in to read the full explanation
  23. What is printed by this C code?

    int *i, a = 12, b = 2, c;
    c = (a = a + b, b = a / b, a = a * b, b = a - b);
    i = &c;
    printf("%d", --(*i));
    
    1. A91
    2. B90
    3. C98
    4. D92

    Answer: (B) 90

    Explanation

    Sign in to read the full explanation
  24. For C operators &&, +=, >>, >=, and ?:, what is the precedence order from higher to lower?

    1. A
      , >=, ?:, +=, &&
    2. B
      , &&, >=, ?:, +=
    3. C
      , >=, &&, ?:, +=
    4. D
      =, >>, &&, +=, ?:

    Answer: (C)

    , >=, &&, ?:, +=

    Explanation

    Sign in to read the full explanation
  25. Which pointer operations are legal in C?

    1. AA, B, C only
    2. BA, B, D only
    3. CA and B only
    4. DA and E only

    Answer: (D) A and E only

    Explanation

    Sign in to read the full explanation
  26. Practise Programming Languages and Computer Graphics in a timed set
  27. Editorially repaired version of an NTA-dropped item. Treat the following descriptions as a one-to-one matching. Which mapping is correct?

    List IList II
    A. OverloadingI. An overridden method call is selected at runtime
    B. Early bindingII. A function call is resolved at compile time
    C. Method overridingIII. Supports compile-time polymorphism
    D. Late bindingIV. Supports runtime polymorphism
    1. AA-III, B-II, C-I, D-IV
    2. BA-IV, B-II, C-III, D-I
    3. CA-III, B-I, C-IV, D-II
    4. DA-IV, B-I, C-III, D-II

    Answer: (A) A-III, B-II, C-I, D-IV

    Explanation

    Sign in to read the full explanation
  28. Match oblique, cavalier, cabinet, and orthographic projection with their defining projection properties.

    List IList II
    A. Oblique projectionI. Perpendicular lines are foreshortened
    B. Cavalier projectionII. Perpendicular lines are not foreshortened
    C. Cabinet projectionIII. Projectors are perpendicular to the plane
    D. Orthographic projectionIV. Projector angle to plane is not 90°
    1. AA-III, B-II, C-IV, D-I
    2. BA-IV, B-II, C-I, D-III
    3. CA-III, B-I, C-IV, D-II
    4. DA-IV, B-I, C-III, D-II

    Answer: (B) A-IV, B-II, C-I, D-III

    Explanation

    Sign in to read the full explanation
  29. Which statement is not true about global variables?

    1. AValues of global variables sent to a called function may be changed inadvertently by that function.
    2. BFunctions lose their independence and isolation when they use global variables.
    3. CIt is not immediately apparent to a reader which values are sent to a called function.
    4. DA function that uses global variables does not suffer from reusability.

    Answer: (D) A function that uses global variables does not suffer from reusability.

    Explanation

    Sign in to read the full explanation
  30. The light given off by a phosphor during exposure to an electron beam is known as

    1. AFluorescence
    2. BPhosphorescence
    3. CPersistence
    4. DRetracing

    Answer: (A) Fluorescence

    Explanation

    Sign in to read the full explanation
  31. Match C file functions with their uses.

    List-IList-II
    A. fseek()
    B. ftell()
    C. feof()
    D. rewind()
    I. Current file position
    II. Beginning of file
    III. Desired file position
    IV. End-of-file test
    1. AA-II, B-III, C-I, D-IV
    2. BA-III, B-I, C-IV, D-II
    3. CA-III, B-I, C-II, D-IV
    4. DA-II, B-IV, C-III, D-I

    Answer: (B) A-III, B-I, C-IV, D-II

    Explanation

    Sign in to read the full explanation
  32. Arrange the 2-D viewing transformation pipeline.

    A. Convert world coordinates to viewing coordinates.
    B. Map viewing coordinates to normalized viewing coordinates using window–viewport specifications.
    C. Construct the world-coordinate scene using modelling-coordinate transformations.
    D. Map normalized viewport coordinates to device coordinates.

    1. AD, C, B, A
    2. BD, C, A, B
    3. CC, A, B, D
    4. DB, C, A, D

    Answer: (C) C, A, B, D

    Explanation

    Sign in to read the full explanation
  33. Consider the conditional statement if (m == 20 - 10 || n > 10). What is the order of execution of the following operations?

    A. ==
    B. -
    C. ||
    D. >

    1. AD, B, A, C
    2. BB, D, C, A
    3. CB, D, A, C
    4. DA, B, D, C

    Answer: (C) B, D, A, C

    Explanation

    Sign in to read the full explanation
  34. Which of the following statements is not true?

    1. AA data member of a class can be declared static and is normally used to maintain values common to the entire class.
    2. BA friend function can be invoked like a normal function without the help of any object.
    3. CThe scope-resolution operator (::) can be overloaded like normal operators.
    4. DMultiple inheritance may duplicate inherited members from a grandparent base class; this may be avoided by making the common base class virtual.

    Answer: (C) The scope-resolution operator (::) can be overloaded like normal operators.

    Explanation

    Sign in to read the full explanation
  35. The major adverse side effects of scan conversion are:

    A. Staircase appearance
    B. Unequal brightness of slanted lines
    C. Picket-fence problem
    D. Rasterization
    E. Pre-filtering and post-filtering

    1. AA and B only
    2. BA, B and C only
    3. CB, C and D only
    4. DC, D and E only

    Answer: (B) A, B and C only

    Explanation

    Sign in to read the full explanation
  36. Consider:

    int x = 10, y = 15;
    x = ((x = y) ? (y + x) : (y - x));

    What is the value of x after execution?

    1. A5
    2. B25
    3. C15
    4. D30

    Answer: (D) 30

    Explanation

    Sign in to read the full explanation
  37. Which of the following statements about
    pointers in C are TRUE.
    A. Pointers can be used to access array elements
    B. Pointers can store the address of another
    pointer
    C. Pointers are automatically dereferenced in
    expression
    D. Pointers cannot be used to access structure
    members

    1. A(A) and (C) Only
    2. B(A) and (B) Only
    3. C(B) and (C) Only
    4. D(C) and (D) Only

    Answer: (B) (A) and (B) Only

    Explanation

    Sign in to read the full explanation
  38. Consider the function in C code :

    Cal(a, b) {
    if( b!=1 ) {
    if( a!=1 ) {
    printf("*");
    Cal(a/2,b);
    }
    else {
    b=b-1;
    Cal(10,b);
    }
    }
    }
    How many times * is going to be printed, if the
    function is called with Cal(10, 10); ?
    
    1. A25
    2. B23
    3. C24
    4. D27

    Answer: (D) 27

    Explanation

    Sign in to read the full explanation
  39. Which of the following is correct way to declare a
    functional pointer in C ?

    1. Aint *func (int, int);
    2. Bint (*func) (int, int);
    3. Cint (func*) (int, int);
    4. Dint func (int, int);

    Answer: (B) int (*func) (int, int);

    Explanation

    Sign in to read the full explanation
  40. Consider the following C program :

    #include<stdio.h>
    int main() {
    int x[] = {2,4,6,8,10};
    int a, b=0, *y=x+4;
    for( a=0; a<5; a++) {
    b = b +(*y-a) - *(y-a);
    }
    printf("%d\n",b);
    return 0;
    }
    What will be the output of the above C program
    ?
    
    1. A4
    2. B6
    3. C8
    4. D10

    Answer: (D) 10

    Explanation

    Sign in to read the full explanation
  41. Which of the following are TRUE about
    constructors in C++ ?
    A. A constructor can be overloaded.
    B. A constructor does not have a return type.
    C. A constructor must be declared as a friend
    function.
    D. A constructor is called when an object is
    destroyed.

    1. A(B), (C), (D) Only
    2. B(B), (C) Only
    3. C(A), (B), (C) Only
    4. D(A), (B) Only

    Answer: (D) (A), (B) Only

    Explanation

    Sign in to read the full explanation
  42. #include<stdio.h>
    void f1(char *x, char *y) {
    char *t1;
    t1 = x;
    x = y;
    y = t1;
    }
    void f2(char **x, char **y) {
    char *t1;
    t1 = *x;
    *x = *y;
    *y = t1;
    }
    int main() {
    char *a = "ONE", *b = "TWO";
    f1(a, b);
    printf("%s %s ", a, b);
    f2(&a, &b);
    printf("%s %s", a, b);
    return 0;
    }
    

    What is the output of the program?

    1. AONE TWO TWO ONE
    2. BTWO ONE ONE TWO
    3. CONE TWO ONE TWO
    4. DTWO ONE TWO ONE

    Answer: (A) ONE TWO TWO ONE

    Explanation

    Sign in to read the full explanation
  43. Which of the following C++ statements correctly
    declares an abstract class ?

    1. Aclass A { virtual void show ()=0 ; };
    2. Bclass A { void show ()=0 ; };
    3. Cclass A { void show() { } ; } ;
    4. Dclass A { show ()=0; };

    Answer: (A) class A { virtual void show ()=0 ; };

    Explanation

    Sign in to read the full explanation
  44. Match List-I with List-II.

    List-I (computing systems)List-II (working/output)
    (A) Half Adder(I) Has n input and 2ⁿ output
    (B) Decoder(II) CPU Storage Unit
    (C) Register(III) Used to store program at runtime
    (D) Main memory(IV) 2-bit addition circuit
    1. A(A)-(II), (B)-(III), (C)-(IV), (D)-(I)
    2. B(A)-(IV), (B)-(II), (C)-(III), (D)-(I)
    3. C(A)-(IV), (B)-(I), (C)-(II), (D)-(III)
    4. D(A)-(II), (B)-(IV), (C)-(III), (D)-(I)

    Answer: (C) (A)-(IV), (B)-(I), (C)-(II), (D)-(III)

    Explanation

    Sign in to read the full explanation
  45. Consider the following statements regarding
    combinational and sequential circuits.
    A. Output of combinational circuits depends on
    the only current input.
    B. Output of combinational circuit depends on
    the both current input and previous output.
    C. Output of sequential circuit depends on the
    current input.
    D. Output of sequential circuit depends on both
    current input and previous output.

    1. A(A) and (C) Only
    2. B(A) and (D) Only
    3. C(B) and (D) Only
    4. D(B) and (C) Only

    Answer: (B) (A) and (D) Only

    Explanation

    Sign in to read the full explanation
  46. #include<iostream.h>
    using namespace std;
    void swap(int &x, int &y)
    {
    int temp=x;
    x=y;
    y=temp;
    }
    int main()
    {
    int a=5, b=10;
    swap(a,b);
    swap(a,b);
    cout<<a<<" "<<b;
    return 0;
    }
    What will be the output of the above code?
    
    1. A5, 10
    2. B10, 5
    3. C5, 5
    4. D10, 10

    Answer: (A) 5, 10

    Explanation

    Sign in to read the full explanation
  47. What is the output of the code given below :

    #include<iostream.h>
    using namespace std;
    class Base {
    public:
    Base(){
    cout<<"Base Const";
    }
    virtual ~Base() {
    cout<<"Base dest";
    }
    };
    class Derived : public Base {
    public:
    Derived() {
    cout<<"Derived Const";
    }
    ~Derived() {
    cout<<"Derived dest";
    }
    };
    int main() {
    Base *b = new Derived();
    delete b;
    return 0;
    }
    
    1. ABase Const Derived Const Derived dest Base dest
    2. BBase Const Derived Const Base dest Derived dest
    3. CDerived Const Base Const Base dest Derived dest
    4. DBase Const Derived Const Base dest

    Answer: (A) Base Const Derived Const Derived dest Base dest

    Explanation

    Sign in to read the full explanation
  48. Consider the following C code:

    #include<stdio.h>
    int temp =0;
    int fun(int x, int y)
    {
    int z; temp++;
    if(y==3) return (x*x*x);
    else {
    z=fun(x,y/3);
    return (z*z*z);
    }
    }
    int main() {
    fun(4,81);
    printf("%d",temp);
    }
    what will be the output of the following code :
    
    1. A3
    2. B4
    3. C5
    4. D6

    Answer: (B) 4

    Explanation

    Sign in to read the full explanation
  49. Arrange the following steps of file handling in C
    in the correct order :
    A. Close the file
    B. Read from or write to the file
    C. Open the file
    D. Check for error

    1. A(A), (C), (D), (B)
    2. B(D), (B), (C), (A)
    3. C(C), (D), (B), (A)
    4. D(B), (D), (A), (C)

    Answer: (C) (C), (D), (B), (A)

    Explanation

    Sign in to read the full explanation
  50. What will be the output of the following C code?

    #include<stdio.h>
    void main()
    {
    int arr[5] = {10,20,30,40,50};
    int *p = (int*) (&arr +1);
    printf("%d%d", *(arr+1), *(p-1));
    }
    
    1. A10 50
    2. B20 50
    3. C30 40
    4. D20 40

    Answer: (B) 20 50

    Explanation

    Sign in to read the full explanation
  51. #include<stdio.h>
    void main()
    {
    int arr[ ] = {1, 2, 3, 4, 5};
    int *p = arr;
    printf("%d", *p++);
    printf("%d", *(p+1));
    }
    Find the output of the above code?
    
    1. A1,2
    2. B1,3
    3. C2,3
    4. D1,4

    Answer: (B) 1,3

    Explanation

    Sign in to read the full explanation
  52. Practise Programming Languages and Computer Graphics in a timed set
  53. A program that is used by other routines to accomplish a particular task, is called :

    1. AMicro program
    2. BMicro operation
    3. CRoutine
    4. DSubroutine

    Answer: (D) Subroutine

    Explanation

    Sign in to read the full explanation
  54. Consider a triangle PQR with coordinates as 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. A(—20, —12), Q(—20, —4) and R(10, 4)
    2. B(—30, —12), Q(—22, —4) and R(10, 4)
    3. C(—25, —10), Q(22, —4) and R(10, 4)
    4. D(30, —12), Q(—22, 4) and R(10, 4)

    Answer: (B) (—30, —12), Q(—22, —4) and R(10, 4)

    Explanation

    Sign in to read the full explanation
  55. Which of the following statements is TRUE ?

    1. AVirtual functions do not implement polymorphism
    2. BVirtual functions do not permit calling of derived class functions using a base class pointer
    3. CWe can never build an object from a class containing a pure virtual function
    4. DPure virtual functions can never have a body

    Answer: (C) We can never build an object from a class containing a pure virtual function

    Explanation

    Sign in to read the full explanation
  56. 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. A990
    2. B9990
    3. C999-1
    4. D99-1

    Answer: (C) 999-1

    Explanation

    Sign in to read the full explanation
  57. A system bus in which each data item is transferred during a time slice known in advance to both units source and destination is called :

    1. AMIMD
    2. BDMA
    3. Casynchronous bus
    4. Dsynchronous bus

    Answer: (D) synchronous bus

    Explanation

    Sign in to read the full explanation
  58. Which of the following are tautology ?
    A. @3PAQ)3(23Q)
    B. (€3Q)Q)>PvQ) (CQ) (VAP) 3Q)((PV>P)R)
    D. (Q4(PAAP))3(R(PA=P)) Choose the correct answer from the options given below :

    1. A(A) Only
    2. B(B) Only
    3. C(A) and(B) Only
    4. D(©) and (D) Only

    Answer: (C) (A) and(B) Only

    Explanation

    Sign in to read the full explanation
  59. Consider the three points P1(1, 2, 0), P2(3, 6, 20) and P3(2, 4, 6) and a view point C(0, 0, —10). Choose the correct options.
    A. P1 obscure P2, if viewed from
    C.
    B. 2 obscure 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(A), (B) and (© Only
    2. B(A), (© and (D) Only
    3. C(B), (©) and (D) Only
    4. D(A), (B) and (D) Only

    Answer: (B) (A), (© and (D) Only

    Explanation

    Sign in to read the full explanation
  60. Find the number of tuples by applying the operation Xb x05 aye"

    X (S, Si, C)Y (S, P, D)

    (J, 1, M)

    (B, 2, N)

    (R, 3, H)

    (T, 4, G)

    (J, S₁, CA)

    (B, P₁, AB)

    (R, D₁, DC)

    (A, H₁, MD)

    1. A1
    2. B3
    3. C4
    4. D6

    Answer: (C) 4

    Explanation

    Sign in to read the full explanation
  61. Match List-I with List-II.

    Source matching promptSource values
    See question stemSee answer choices
    1. A(A), (B)-V), ©)-(, (P)-CI)
    2. B(A), (B)-(D, (C)-@), (D)-(IV)
    3. C(A)-(HD), (B)-@D, (C)-CV), (B)-)
    4. D(A)-(), (B)-(V), (C)-@D), (D)-@)

    Answer: (A) (A), (B)-V), ©)-(, (P)-CI)

    Explanation

    Sign in to read the full explanation
  62. Match List-I with List-II.

    Source matching promptSource values
    See question stemSee answer choices
    1. A(A), (B)-(), (©-€V), (D)-()
    2. B(A)-(), (B)-CV), (©-(), (P)-@)
    3. C(A)-(, (B)-()), (©-€V), (D)-()
    4. D(A)-(1D), (B)-(), (C)-(IV), (D)-

    Answer: (A) (A), (B)-(), (©-€V), (D)-()

    Explanation

    Sign in to read the full explanation
  63. The clipping process in computer graphics is used for

    1. AAdding graphics
    2. BCopying
    3. CZooming
    4. DRemoving objects and lines

    Answer: (D) Removing objects and lines

    Explanation

    Sign in to read the full explanation
  64. 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. A20
    2. B24
    3. CGarbage
    4. Derror

    Answer: (B) 24

    Explanation

    Sign in to read the full explanation
  65. What is the output of the following code?

    int 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);
     return 0;
    }
    
    1. ANagpur Raipur Kanpur
    2. BNagpur Nagpur Nagpur
    3. CKanpur Kanpur Kanpur
    4. DError

    Answer: (B) Nagpur Nagpur Nagpur

    Explanation

    Sign in to read the full explanation
  66. 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. Amemfree (int p);
    2. Bdealloc (p);
    3. Cmalloc (p, 0);
    4. Dfree (p);

    Answer: (D) free (p);

    Explanation

    Sign in to read the full explanation
  67. Which two-dimensional transformation is used to resize a two-dimensional object?

    1. ATranslation
    2. BRotation
    3. CScaling
    4. DShearing

    Answer: (C) Scaling

    Explanation

    Sign in to read the full explanation
  68. Match List I with List II on curve and surface representations.

    List-IList-II
    A. Bezier curvesI. 3 dim objects that have translation rotational symmetry
    B. B-SplinesII. Fractal geometry
    C. Sweep representationsIII. Bias and tension
    D. Natural objectsIV. painting drawing CAD

    List I / List II: computer graphics representation techniques

    1. AA-IV, B-I, C-III, D-II
    2. BA-II, B-III, C-IV, D-I
    3. CA-IV, B-III, C-I, D-II
    4. DA-II, B-IV, C-I, D-III

    Answer: (C) A-IV, B-III, C-I, D-II

    Explanation

    Sign in to read the full explanation
  69. Sutherland Hodgman method is used on

    1. ASmooth curves
    2. BLine segment
    3. CConvex polygons
    4. DConcave polygons

    Answer: (C) Convex polygons

    Explanation

    Sign in to read the full explanation
  70. Consider the rectangle with vertices (0, 0), (0, 2), (3, 0), (3, 2). There is scaling of 2 towards x-axis and 3 towards y-axis. The new coordinates of the rectangle are

    1. A(0, 0), (6, 0), (0, 4), (6, 4)
    2. B(0, 0), (6, 0), (0, 4), (3, 2)
    3. C(0, 0), (6, 0), (0, 6), (6, 6)
    4. D(0, 0), (4, 0), (0, 6), (4, 6)

    Answer: (C) (0, 0), (6, 0), (0, 6), (6, 6)

    Explanation

    Sign in to read the full explanation
  71. 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. A13.25, 4.5
    2. B1.5, 3.5
    3. C13.24, 1.5, 4.5, 5.4, 3.5
    4. DIllegal use of pointer in main function

    Answer: (D) Illegal use of pointer in main function

    Explanation

    Sign in to read the full explanation
  72. What is the type of x in the following program?

    #include <stdio.h>
    int main()
    {
        typedef (*(*arrfptr[3])())[10];
        arrfptr x;
        return 0;
    }
    
    1. Ax is a pointer
    2. Bx is a array of three pointer
    3. Cx is an array of three function pointer
    4. DError in x declaration

    Answer: (C) x is an array of three function pointer

    Explanation

    Sign in to read the full explanation
  73. Consider the following conditional code, which returns a Boolean value:

    if ((x > 25) && (y > 100))
        return 'false';
    else if ((x <= 25) && (y <= 100))
        return 'true';
    else if ((x > 25) && (y <= 100))
        return 'false';
    else
        return 'true';
    

    Simplify it by filling in the following blank with a single Boolean expression without changing the behaviour of the conditional code:

    if (------)
        return 'true';
    else
        return 'false';
    
    1. Ax > 25
    2. Bx <= 25
    3. Cy > 100
    4. Dy <= 100

    Answer: (B) x <= 25

    Explanation

    Sign in to read the full explanation
  74. If a constructor 'Date' is declared explicitly and has to be defined outside the class, which of the following is correct?

    1. ADate::Date(int dd) { /.../ }
    2. Bexplicit Date:: Date(int dd) { /.../ }
    3. CSuch a constructor cannot be defined
    4. DConstructor always has to be defined inside the class

    Answer: (A) Date::Date(int dd) { /.../ }

    Explanation

    Sign in to read the full explanation
  75. Which one of the following allows the session to continue?

    1. AWhen a user quits a browser
    2. BWhen the user logs out and is invalidated by the servlet
    3. CWhen the session is timed out due to inactivity
    4. DWhen the user refreshes the browser and there is a persistent cookie

    Answer: (D) When the user refreshes the browser and there is a persistent cookie

    Explanation

    Sign in to read the full explanation
  76. Given a vector with cartesian components (x,y), if scaling is done with matrix [[0.5, 0], [0, 1.5]] which of the following are true.

    A. Decreases the vertical by three halves
    B. Increases the vertical by three halves
    C. Doubles the horizontal
    D. Halves the horizontal

    Choose the correct answer from the options given below:

    1. AA and C only
    2. BA and D only
    3. CB and C only
    4. DB and D only

    Answer: (D) B and D only

    Explanation

    Sign in to read the full explanation
  77. Which of the following lists defined in HTML share similar elements?

    A. Unordered lists
    B. Ordered lists
    C. Definition Lists
    D. Correlated lists
    E. Enumerated lists

    Choose the most appropriate answer from the options given below:

    1. AA, B, D only
    2. BA, C, E only
    3. CA, B, C only
    4. DA, C, D only

    Answer: (C) A, B, C only

    Explanation

    Sign in to read the full explanation
  78. Practise Programming Languages and Computer Graphics in a timed set
  79. Match List I with List II.

    List-IList-II
    A. If the implementation of generated or derived classes differ only through a parameter, we haveI. To use class hierarchy
    B. If the actual types of objects used cannot be known at compile time, then we haveII. Improved run-time efficiency
    C. If inline operations are essential and templates are used then we haveIII. To use templates
    D. To gain access to differing instances for derived classes through base we haveIV. To use explicit casting

    List I and List II for the matching question

    1. AA-I, B-II, C-IV, D-III
    2. BA-III, B-I, C-II, D-IV
    3. CA-I, B-III, C-II, D-IV
    4. DA-II, B-I, C-III, D-IV

    Answer: (B) A-III, B-I, C-II, D-IV

    Explanation

    Sign in to read the full explanation
  80. In what sequence the initialization, testing and execution of body is done while using do-while loop?

    A. Commenting
    B. Execution of the body
    C. Initialisation
    D. Testing the condition

    Choose the correct answer from the following

    1. AD,B,C
    2. BD,C,B
    3. CC,A,B
    4. DC,B,D

    Answer: (D) C,B,D

    Explanation

    Sign in to read the full explanation
  81. Assertion (A): A Raster scan device is a CRT graphic device and can use a television monitor for display.

    Reason (R): In Raster scan display the picture is composed of a series of dots. These dots are traced out as a series of horizontal lines. Television works in a similar fashion.

    In the light of the above statements, choose the correct answer from the options given below:

    1. ABoth A and R are true and R is the correct explanation of A
    2. BBoth A and R are true but R is not the correct explanation of A
    3. CA is true but R is false
    4. DA is false but R is true

    Answer: (A) Both A and R are true and R is the correct explanation of A

    Explanation

    Sign in to read the full explanation
  82. Given

    int arr[3][4][2] = {{{2,4},{7,8},{3,4},{5,6}},{{7,6},{3,4},{5,3},{2,3}},{{8,9},{7,2},{3,4},{5,1}}};

    Which one of the following can be used to refer to element 1 in the above 3-d array?

    1. Aarr[3][4][2]
    2. B((*(arr+2)+3)+1)
    3. C*(arr+2) + *(arr+3) + *(arr+1)
    4. Darr[2][3][2]

    Answer: (B) ((*(arr+2)+3)+1)

    Explanation

    Sign in to read the full explanation
  83. Allowing different derived classes to be used interchangeably through the interface provided by a common base class is called ______.

    1. ADerived polymorphism
    2. BCompile time polymorphism
    3. CStatic polymorphism
    4. DRun time polymorphism

    Answer: (D) Run time polymorphism

    Explanation

    Sign in to read the full explanation
  84. In ______ curve the last and the first vertices of the polygon lie on the curve and all other vertices define the derivatives, order and shape of the curve.

    1. AB-Spline Curve
    2. BBoxline curve
    3. CBezier curve
    4. DGaussian curve

    Answer: (C) Bezier curve

    Explanation

    Sign in to read the full explanation
  85. FFTs are ________ techniques used to encode digital video and audio information and helps analyse the signal in __________ domain.

    1. AEncryption, time
    2. BEncryption, frequency
    3. CCompression, time
    4. DCompression, frequency

    Answer: (D) Compression, frequency

    Explanation

    Sign in to read the full explanation
  86. Inheritance provides the benefits of ________.

    A. shared interfaces
    B. run-time polymorphism
    C. less redundant information
    D. dynamic binding

    Choose the Correct answer from the options given below:

    1. AA, B, C only
    2. BA, B, D only
    3. CB, C, D only
    4. DA, C, D only

    Answer: (B) A, B, D only

    Explanation

    Sign in to read the full explanation
  87. Which of the following are correct using the constructor?

    A. string s1
    B. string s2 (s1)
    C. string s3 {7}
    D. string s4 {'a'}
    E. string s5{7,'a'}

    Choose the most appropriate answer from the options given below:

    1. AA, B, D, E only
    2. BA, B, C only
    3. CA, B, D only
    4. DA and B only

    Answer: (A) A, B, D, E only

    Explanation

    Sign in to read the full explanation
  88. Suppose that a corporate website appearance varies according to the department that owns various documents. All the documents need to follow the corporate look and feel. The HR department does not need a separate style sheet. It needs only the sheet containing the difference from the corporate sheet.

    Which of the following statements justify the above scenario?

    A. The styles sheets cannot stack on each other
    B. The style sheets can stack on each other
    C. The style sheets can override each other
    D. The style sheets cannot override each other

    Choose the most appropriate answer from the options given below:

    1. AA, C Only
    2. BB, C Only
    3. CB, D only
    4. DA, D only

    Answer: (B) B, C Only

    Explanation

    Sign in to read the full explanation
  89. Match List I with List II.

    List-IList-II
    A. 2-D Array InputI. Liquid Crystal display
    B. Transmissive deviceII. Flat-bed scanner
    C. Binary imageIII. Camera
    D. 1-D array inputIV. Ink jet printer
    1. AA-I, B-III, C-II, D-IV
    2. BA-III, B-I, C-IV, D-II
    3. CA-III, B-I, C-II, D-IV
    4. DA-I, B-II, C-IV, D-III

    Answer: (B) A-III, B-I, C-IV, D-II

    Explanation

    Sign in to read the full explanation
  90. Hidden surface removal problem with minimal 3D pipeline can be solved with

    1. APainter's algorithm
    2. BWindow Clipping algorithm
    3. CBrute force rasterization algorithm
    4. DFlood fill algorithm

    Answer: (A) Painter's algorithm

    Explanation

    Sign in to read the full explanation
  91. The condition num != 65 cannot be replaced by

    1. Anum > 65 || num < 65
    2. B!(num == 65)
    3. Cnum − 65
    4. D!(num = 65)

    Answer: (D) !(num = 65)

    Explanation

    Sign in to read the full explanation
  92. Pointers cannot be used to

    1. Afind the address of a variable in memory
    2. Breference value directly
    3. Csimulate call by reference
    4. Dmanipulate dynamic data structure

    Answer: (B) reference value directly

    Explanation

    Sign in to read the full explanation
  93. This transformation is called
    [x̅ y̅ z̅ w̅]ᵀ = [[a₁ b₁ c₁ d₁],[a₂ b₂ c₂ d₂],[a₃ b₃ c₃ d₃],[e f g h]] [x y z 1]ᵀ

    1. AScaling
    2. BShear
    3. CHomography
    4. DSteganography

    Answer: (C) Homography

    Explanation

    Sign in to read the full explanation
  94. Of the following, which is NOT a logical error?

    1. AUsing the '=', instead of '==' to determine if two values are equal
    2. BDivide by zero
    3. CFailing to initialize counter and total variables before the body of loop
    4. DUsing commas instead of two required semicolon in a for loop header

    Answer: (B) Divide by zero

    Explanation

    Sign in to read the full explanation
  95. Which statement is false?

    1. AAll function calls in C pass arguments using call by value.
    2. BCall by reference enables a called function to modify a variable in calling function.
    3. CCall by value is always more efficient than call by reference.
    4. DProgrammers use pointers and indirection operation to simulate call by reference.

    Answer: (C) Call by value is always more efficient than call by reference.

    Explanation

    Sign in to read the full explanation
  96. It is always important and useful to include an 'alt' attribute on an 'img' tag in HTML. Which of the reasons given below is/are correct?

    A. Users who cannot see the image due to vision impairment can be given a textual description that a screen reader speaks aloud.
    B. If the image fails to load (slow connection, broken path, etc.), the alt text is displayed instead.
    C. It gives SEO (Search Engine Optimization) benefits.

    Choose the correct answer from the options given below:

    1. AA only
    2. BB and C only
    3. CC only
    4. DA, B, and C

    Answer: (D) A, B, and C

    Explanation

    Sign in to read the full explanation
  97. What does the following function f() in C return?

    int f(unsigned int N) {
        unsigned int counter = 0;
        while (N > 0) {
            counter += N & 1;
            N = N >> 1;
        }
        return counter == 1;
    }
    
    1. A1 if N is odd, otherwise 0
    2. B1 if N is a power of 2, otherwise 0
    3. C1 if the binary representation of N is all 1s, otherwise 0
    4. D1 if the binary representation of N has any 1s, otherwise 0

    Answer: (B) 1 if N is a power of 2, otherwise 0

    Explanation

    Sign in to read the full explanation
  98. Consider the following recursive function F() in Java that takes an integer and returns a String:

    public static String F(int N) {
        if (N <= 0) return "-";
        return F(N - 3) + N + F(N - 2) + N;
    }
    

    What is the value of F(5)?

    1. A-2-25-3-135
    2. B-2-25-1-3-135
    3. C-1-145-2-245
    4. D-2-25-3-1-135

    Answer: (D) -2-25-3-1-135

    Explanation

    Sign in to read the full explanation
  99. Match List-I (Programming Terms) with List-II (Meaning).

    List-IList-II
    A. JNDII. Runtime support for running a Java program
    B. RMIII. The API in support of naming and directory services
    C. JDKIII. The methods and runtime support for calling remote methods
    D. JREIV. The compiler and class libraries to develop Java applications
    1. AA-II, B-III, C-IV, D-I
    2. BA-II, B-IV, C-III, D-I
    3. CA-I, B-III, C-IV, D-II
    4. DA-III, B-II, C-IV, D-I

    Answer: (A) A-II, B-III, C-IV, D-I

    Explanation

    Sign in to read the full explanation
  100. Match List-I (Programming Paradigms) with List-II (Characteristics).

    List-IList-II
    A. ImperativeI. Declarative, clausal representation, theorem proving
    B. Object-orientedII. Side-effect-free, declarative, expression evaluation
    C. LogicIII. Imperative, abstract data type
    D. FunctionalIV. Command-based, procedural
    1. AA-IV, B-III, C-I, D-II
    2. BA-III, B-IV, C-I, D-II
    3. CA-IV, B-III, C-II, D-I
    4. DA-II, B-III, C-I, D-IV

    Answer: (A) A-IV, B-III, C-I, D-II

    Explanation

    Sign in to read the full explanation
  101. You have eight black-and-white images taken with a 1-megapixel camera and one 8-colour image taken with an 8-megapixel camera. How much disk space in total is needed to store these images?

    1. A1 GB
    2. B4 MB
    3. C3 MB
    4. D3 GB

    Answer: (B) 4 MB

    Explanation

    Sign in to read the full explanation
  102. The midpoint (Bresenham) algorithm for rasterizing lines is optimized relative to the DDA algorithm in that:

    A. It avoids round-off operations.
    B. It is incremental.
    C. It uses only integer arithmetic.
    D. All straight lines can be displayed as exactly straight.

    Choose the correct answer from the options given below:

    1. AA and B only
    2. BA and C only
    3. CA, B, C, and D
    4. DA, B, and C only

    Answer: (D) A, B, and C only

    Explanation

    Sign in to read the full explanation
  103. Find the transformation matrix M that maps the square with vertices (1,1), (-1,1), (-1,-1), (1,-1) to the parallelogram with corresponding vertices (2,1), (0,1), (-2,-1), (0,-1).

    1. A[[1, 1, 0], [0, 1, 0], [0, 0, 1]]
    2. B[[1, 0, 0], [1, 1, 0], [0, 0, 1]]
    3. C[[1, 1, 1], [0, 1, 0], [0, 0, 1]]
    4. D[[1, 1, 0], [1, 1, 0], [0, 0, 1]]

    Answer: (A) [[1, 1, 0], [0, 1, 0], [0, 0, 1]]

    Explanation

    Sign in to read the full explanation
  104. Practise Programming Languages and Computer Graphics in a timed set
  105. A Bezier curve P(t) is defined by four control points in the xy-plane: P0 = (-2, 0), P1 = (-2, 4), P2 = (2, 4), P3 = (2, 0). Which statements are correct?

    A. P(t) has degree 3.
    B. P(1/2) = (0, 3).
    C. P(t) may extend outside the convex hull of its control points.

    Choose the correct answer from the options given below:

    1. AA and B only
    2. BA and C only
    3. CB and C only
    4. DA, B, and C

    Answer: (A) A and B only

    Explanation

    Sign in to read the full explanation
  106. Statement I: The maximum number of sides a triangle can have after being clipped to a rectangular viewport is 6.
    Statement II: In 3D graphics, the perspective transformation is nonlinear in z.

    In light of the above statements, choose the correct answer from the options given below:

    1. ABoth Statement I and Statement II are true
    2. BBoth Statement I and Statement II are false
    3. CStatement I is true but Statement II is false
    4. DStatement I is false but Statement II is true

    Answer: (D) Statement I is false but Statement II is true

    Explanation

    Sign in to read the full explanation
  107. In HTML, the <map> tag is used for

    1. Adefining a path between two nodes in an image
    2. Bdefining clickable regions in an image
    3. Chighlighting an area in an image
    4. Ddefining the site map of a website

    Answer: (B) defining clickable regions in an image

    Explanation

    Sign in to read the full explanation
  108. A compiler uses 1-byte chars, 2-byte shorts, 4-byte ints, and 8-byte doubles. Every primitive must begin at an address that is a multiple of its size; fields cannot be reordered. How much space is consumed by an array A[10] of this structure?

    struct { short s; char c; short t; char d; double r; int i; }

    1. A150 bytes
    2. B320 bytes
    3. C240 bytes
    4. D200 bytes

    Answer: (C) 240 bytes

    Explanation

    Sign in to read the full explanation
  109. Consider the recursive Java function:

    public static float f(long m, long n) {
    float result = (float)m / (float)n;
    if (m < 0 || n < 0) return 0.0f;
    else result -= f(m + 2, n * 3);
    return result;
    }

    Which real value best approximates f(1, 3)?

    1. A0.2
    2. B0.4
    3. C0.6
    4. D0.8

    Answer: (A) 0.2

    Explanation

    Sign in to read the full explanation
  110. Which statements regarding XML are true?
    A. XML is a set of tags designed to tell browsers how to display a web page.
    B. XML defines syntax for representing data, while the data meaning depends on the application.
    C. <Letter>, <LETTER>, and <letter> are different XML tags.

    1. A(A) and (B) only
    2. B(A) and (C) only
    3. C(B) and (C) only
    4. D(A), (B), and (C)

    Answer: (C) (B) and (C) only

    Explanation

    Sign in to read the full explanation
  111. In 3D computer graphics, which statements are correct?
    A. Under perspective projection, parallel lines generally do not remain parallel, except lines parallel to the view plane.
    B. The perspective step uses a division by the depth coordinate after homogeneous transformation.
    C. Perspective transformation is linear.

    1. A(A) and (B) only
    2. B(A) and (C) only
    3. C(B) and (C) only
    4. D(A), (B), and (C)

    Answer: (A) (A) and (B) only

    Explanation

    Sign in to read the full explanation
  112. For Gouraud and Phong shading, which statements are true?
    A. Gouraud shading requires more computation than Phong shading.
    B. Gouraud shading interpolates vertex colours across a polygon.
    C. Phong shading interpolates vertex normals across a polygon.

    1. A(A) and (B) only
    2. B(A) and (C) only
    3. C(B) and (C) only
    4. D(A), (B), and (C)

    Answer: (C) (B) and (C) only

    Explanation

    Sign in to read the full explanation
  113. Match List-I with List-II. List I gives 3x3 matrices representing 2D transformations and
    List-II shows the corresponding transformation diagrams.

    List I (Matrix) List II (Transformation Diagram)
    2 00
    A. |0 2 0
    001 MO ,
    Shear — x (2).a

    List IList II
    Items are listed in the question stem.Match each item to its stated description or complexity.
    1. A0 2
      (B) jo 1 2 seale (2, 2).a
      00 1L
      (788)
      a
      05 —0.866 0
      (C) |0.866 0.5 0
      0 0 1 rotate(60°).
      (II)
      a
      120
      @) jo 1 0 a
      001 (Iv)
      translate (2, 2).a Choose the correct answer from the options given below:
      1. A-IV, B-II, C-III, D-I (2) A-IV. B-II, C-II, D-I
    2. BOCR review required
    3. CA-II, B-II, C-IV, D-I (4) A-II, B-IV, C-II, D-I
    4. DOCR review required

    Answer: (D) OCR review required

    Explanation

    Sign in to read the full explanation
  114. Given below are different properties of 3D projections from A-D. Identify the correct order on
    the basis of property true of (i) a perspective projection only, (ii) an orthographic projection
    only, (iii) both orthographic and projective transformations and (iv) neither orthographic nor
    projective transformation, respectively.
    A. B. C. D. Straight lines are mapped to straight lines.
    Distances and angles are (in general) preserved.
    Far away objects appear the same size as closer ones.

    Requires homogeneous coordinates in order for it to be encoded into a linear
    transformation.

    1. AOCR review required
    2. BOCR review required
    3. CD, C. B.A (2) B,C,D.A
      D,C, A,B (4) C,D,BA
    4. DOCR review required

    Answer: (C) D, C. B.A (2) B,C,D.A
    D,C, A,B (4) C,D,BA

    Explanation

    Sign in to read the full explanation
  115. Given below are two statements:

    Statement I: Bezier curves are curves that interpolate all of their control points.
    Statement II: A cubic bezier curve has four control points.

    In the light of the above statements, choose the correct answer from the options given below

    1. ABoth Statement I and Statement II are true
    2. BBoth Statement I and Statement II are false
    3. CStatement I is correct but Statement II is false
    4. DStatement I is incorrect but Statement II is true.

    Answer: (D) Statement I is incorrect but Statement II is true.

    Explanation

    Sign in to read the full explanation
  116. Consider the following statements with respect to approaches to fill area on raster systems:

    P. To determine the overlap intervals for scan lines that cross the area
    Q. To start from a given interior position and paint outward from this point until a encounter the specified boundary conditions

    Select the correct answer:

    1. AP only
    2. BQ only
    3. CBoth P and Q
    4. DNeither P nor Q

    Answer: (C) Both P and Q

    Explanation

    Sign in to read the full explanation
  117. Which of the following algorithms is not used for line clipping?

    1. ACohen-Sutherland algorithm
    2. BSoutherland-Hodgeman algorithm
    3. CLiang-Barsky algorithm
    4. DNicholl-Lee-Nicholl algorithm

    Answer: (B) Southerland-Hodgeman algorithm

    Explanation

    Sign in to read the full explanation
  118. Java Virtual Machine (JVM) is used to execute architectural neutral byte code. Which of the following is needed by the JVM for execution of Java Code?

    1. AClass loader only
    2. BClass loader and Java Interpreter
    3. CClass loader, Java Interpreter and API
    4. DJava Interpreter only

    Answer: (C) Class loader, Java Interpreter and API

    Explanation

    Sign in to read the full explanation
  119. Which of the following statements are true regarding C++?

    A. Overloading gives the capability to an existing operator to operate on other data types.
    B. Inheritance in object oriented programming provides support to reusability.
    C. When object of a derived class is defined, first the constructor of derived class is executed then constructor of a base class is executed.
    D. Overloading is a type of polymorphism.

    Choose the correct option from the options:

    1. AA and B only
    2. BA, B and C only
    3. CA, B and D only
    4. DB, C and D only

    Answer: (C) A, B and D only

    Explanation

    Sign in to read the full explanation
  120. What is the output of following C program?

    #include <stdio.h>
    main()
    {
     int i, j, x = 0;
     for (i = 0; i < 5; ++i)
     for (j = 0; j < i; ++j)
     {
     x += (i + j - 1);
     break;
     }
     printf ("%d", x);
    }
    
    1. A6
    2. B5
    3. C4
    4. D3

    Answer: (A) 6

    Explanation

    Sign in to read the full explanation
  121. Match List-I with List-II.

    List-IList-II
    (a) Frame attribute(i) to create link in HTML
    (b) <tr> tag(ii) for vertical alignment of content in cell
    (c) Valign attribute(iii) to enclose each row in table
    (d) <a> tag(iv) to specify the side of the table frame that display border
    1. A(a)-(i), (b)-(ii), (c)-(iii), (d)-(iv)
    2. B(a)-(ii), (b)-(i), (c)-(iii), (d)-(iv)
    3. C(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)
    4. D(a)-(iii), (b)-(iv), (c)-(ii), (d)-(i)

    Answer: (C) (a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)

    Explanation

    Sign in to read the full explanation
  122. Let A be the base class in C++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?

    1. AMember function of class B can access protected data of class A
    2. BMember function of Class B can access public data of class A
    3. CMember function of class B cannot access private data of class A
    4. DObject of derived class B can access public base class data

    Answer: (D) Object of derived class B can access public base class data

    Explanation

    Sign in to read the full explanation
  123. Which of the following are legal statements in C programming language?

    (a) int *P = &44;
    (b) int *P = &r;
    (c) int P = &a;
    (d) int P = a;

    Choose the correct option:

    1. A(a) and (b)
    2. B(b) and (c)
    3. C(b) and (d)
    4. D(a) and (d)

    Answer: (C) (b) and (d)

    Explanation

    Sign in to read the full explanation
  124. A rectangle is bound by the lines x = 0; y = 0; x = 5 and y = 3. The line segment joining (-1, 0) and (4, 5), if clipped against this window will connect the points __________.

    1. A(0, 1) and (3, 3)
    2. B(0, 1) and (2, 3)
    3. C(0, 1) and (4, 5)
    4. D(0, 1) and (3, 5)

    Answer: (B) (0, 1) and (2, 3)

    Explanation

    Sign in to read the full explanation
  125. Which tag is used to enclose any number of javascript statements in HTML document?

    1. A<code>
    2. B<script>
    3. C<title>
    4. D<body>

    Answer: (B) <script>

    Explanation

    Sign in to read the full explanation
  126. If we want to resize a 1024 × 768 pixels image to one that is 640 pixels wide with the same aspect ratio, what would be the height of the resized image?

    1. A420 Pixels
    2. B460 Pixels
    3. C480 Pixels
    4. D540 Pixels

    Answer: (C) 480 Pixels

    Explanation

    Sign in to read the full explanation
  127. Question 123

    UGC NET June 2019

    Which of the following statements is/are true?

    P: An XML document with correct syntax as specified by W3C is called "Well Formed".
    Q: An XML documented validated against a DTD is both "Well formed" and "Valid".
    R: <?xml version="1.0" encoding="UTF-8"> is syntactly correct declaration for the version of an XML document.

    Select the correct answer from the options given below:

    1. AP and Q only
    2. BP and R only
    3. CQ and R only
    4. DAll of P, Q and R

    Answer: (A) P and Q only

    Explanation

    Sign in to read the full explanation
  128. Question 124

    UGC NET June 2019

    Consider the following C-code fragment running on a 32-bit x86 machine:

    typedef struct {
      union {
        unsigned char a;
        unsigned short b;
      } U;
      unsigned char c;
    } S;
    
    S B[10];
    S *p = &B[4];
    S *q = &B[5];
    p -> U.b = 0x1234; /* structure S takes 32-bits */
    

    If M is the value of q - p and N is the value of ((int) &(p -> c)) - ((int)p), then (M, N) is

    1. A(1, 1)
    2. B(3, 2)
    3. C(1, 2)
    4. D(4, 4)

    Answer: (C) (1, 2)

    Explanation

    Sign in to read the full explanation
  129. Question 125

    UGC NET June 2019

    Consider the following C++ function f():

    unsigned int f(unsigned int n) {
      unsigned int b = 0;
      while (n) {
        b += n & 1;
        n >>= 1;
      }
      return b;
    }
    

    The function f() returns the int that represents the P in the binary representation of positive integer n, where P is

    1. Anumber of 0's
    2. Bnumber of bits
    3. Cnumber of consecutive 1's
    4. Dnumber of 1's

    Answer: (D) number of 1's

    Explanation

    Sign in to read the full explanation
  130. Practise Programming Languages and Computer Graphics in a timed set
  131. Question 126

    UGC NET June 2019

    Consider a raster system with resolution 640 by 480. What size is frame buffer (in bytes) for this system to store 12 bits per pixel?

    1. A450 kilobytes
    2. B500 kilobytes
    3. C350 kilobytes
    4. D400 kilobytes

    Answer: (A) 450 kilobytes

    Explanation

    Sign in to read the full explanation
  132. Question 127

    UGC NET June 2019

    Consider the following statements regarding 2D transforms in computer graphics:
    S1: [1 0; 0 -1] is a 2×2 matrix that reflects (mirrors) any 2D point about the X-axis.
    S2: A 2×2 matrix which mirrors any 2D point about the X-axis, is a rotation matrix.

    What can you say about the statements S1 and S2?

    1. ABoth S1 and S2 are true
    2. BOnly S1 is true
    3. COnly S2 is true
    4. DBoth S1 and S2 are false

    Answer: (B) Only S1 is true

    Explanation

    Sign in to read the full explanation
  133. Question 128

    UGC NET June 2019

    Which of the following statements is/are true?

    P: In a scripting language like JavaScript, types are typically associated with values, not variables.
    Q: It is not possible to show images on a web page without the <img> tag of HTML.

    Select the correct answer from the options given below:

    1. AP only
    2. BQ only
    3. CBoth P and Q
    4. DNeither P nor Q

    Answer: (A) P only

    Explanation

    Sign in to read the full explanation
  134. Question 129

    UGC NET June 2019

    Using the phong reflectance model, the strength of the specular highlight is determined by the angle between

    1. Athe view vector and the normal vector
    2. Bthe light vector and the normal vector
    3. Cthe light vector and the reflected vector
    4. Dthe reflected vector and the view vector

    Answer: (D) the reflected vector and the view vector

    Explanation

    Sign in to read the full explanation
  135. Question 130

    UGC NET June 2019

    What is the output of the following JAVA program?

    public class Good {
      private int m;
      public Good(int m) { this.m = m; }
      public Boolean equals(Good n) { return n.m == m; }
      public static void main (String args []){
        Good m₁ = new Good(22);
        Good m₂ = new Good(22);
        Object s₁ = new Good(22);
        Object s₂ = new Good(22);
        System.out.println(m₁.equals(m₂));
        System.out.println(s₁.equals(s₂));
        System.out.println(m₁.equals(s₂));
        System.out.println(s₁.equals(m₁));
      }
    }
    
    1. ATrue, True, False, False
    2. BTrue, False, True, False
    3. CTrue, True, False, True
    4. DTrue, False, False, False

    Answer: (D) True, False, False, False

    Explanation

    Sign in to read the full explanation
  136. Question 131

    UGC NET June 2019

    In the context of 3D computer graphics, which of the following statements is/are true?
    P: Orthographic transformations keep parallel lines parallel.
    Q: Orthographic transformations are affine transformations.

    Select the correct answer from the options given below:

    1. ABoth P and Q
    2. BNeither P nor Q
    3. COnly P
    4. DOnly Q

    Answer: (A) Both P and Q

    Explanation

    Sign in to read the full explanation
  137. In 3D Graphics, which of the following statements about perspective and parallel projection is/are true ?

    P : In a perspective projection, the farthest an object is from the centre of projection, the smaller it appears.
    Q : Parallel projection is equivalent to a perspective projection where the viewer is standing infinitely far away.
    R : Perspective projections do not preserve straight lines.

    Choose the correct answer from the code given below :
    Code :

    1. AP and Q only
    2. BP and R only
    3. CQ and R only
    4. DP, Q and R

    Answer: (A) P and Q only

    Explanation

    Sign in to read the full explanation
  138. Consider the following recursive Java function if that takes two long arguments and returns a float value :

    public static float f(long m, long n)
    {
     float result = (float) m / (float) n;
     if (m < 0 || n < 0)
     return 0·0f;
     else
     result += f(m*2, n*3);
     return result;
    }
    

    Which of the following integers best approximates the value of f(2, 3) ?

    1. A1
    2. B0
    3. C3
    4. D2

    Answer: (D) 2

    Explanation

    Sign in to read the full explanation
  139. If the frame buffer has 10-bits per pixel and 8-bits are allocated for each of the R, G, and B components, then what would be the size of the color lookup table (LUT) ?

    1. A(2¹⁰ + 2²⁴) bytes
    2. B(2¹⁰ + 2¹¹) bytes
    3. C(2⁸ + 2⁹) bytes
    4. D(2¹⁰ + 2⁸) bytes

    Answer: (B) (2¹⁰ + 2¹¹) bytes

    Explanation

    Sign in to read the full explanation
  140. In 3D Graphics, which of the following statements is/are true ?

    P : Back-face culling is an example of an image-precision visible-surface determination procedure.
    Q : Z-buffer is a 16-bit, 32-bit, or 64-bit field associated with each pixel in a frame buffer that can be used to determine the visible surfaces at each pixel.

    Choose the correct answer from the code given below :
    Code :

    1. AQ only
    2. BP and Q
    3. CNeither P nor Q
    4. DP only

    Answer: (A) Q only

    Explanation

    Sign in to read the full explanation
  141. Which homogeneous 2D matrix transforms figure (a) to figure (b) ?

    2D geometric transformation of Figure (a) to Figure (b)

    2D geometric transformation of Figure (a) to Figure (b)

    1. A[ 1 -2 6 ; 1 0 2 ; 0 0 1 ]
    2. B[ 0 -2 6 ; 1 0 1 ; 0 0 1 ]
    3. C[ 0 2 -6 ; 2 0 1 ; 0 0 1 ]
    4. D[ 0 2 6 ; 1 0 1 ; 0 0 1 ]

    Answer: (B) [ 0 -2 6 ; 1 0 1 ; 0 0 1 ]

    Explanation

    Sign in to read the full explanation
  142. What does the following Java function perform ? (Assume int occupies four bytes of storage)

    public static int f(int a)
    { // Pre-conditions : a > 0 and no overflow/underflow occurs
     int b = 0;
     for (int i = 0; i < 32; i++)
     {
     b = b << 1;
     b = b | (a & 1);
     a = a >>> 1; // This is a logical shift
     }
     return b;
    }
    
    1. AReturn the int that represents the number of 0’s in the binary representation of integer a.
    2. BReturn the int that represents the number of 1’s in the binary representation of integer a.
    3. CReturn the int that has the reversed binary representation of integer a.
    4. DReturns the int that has the binary representation of integer a.

    Answer: (C) Return the int that has the reversed binary representation of integer a.

    Explanation

    Sign in to read the full explanation
  143. Consider the C/C++ function f() given below :

    void f(char w[])
    {
     int x = strlen(w); //length of a string
     char c;
     for (int i = 0; i < x; i++)
     {
     c = w[i];
     w[i] = w[x–i–1];
     w[x–i–1] = c;
     }
    }
    

    Which of the following is the purpose of f( ) ?

    1. AIt outputs the contents of the array in the original order
    2. BIt outputs the contents of the array with the characters shifted over by one position
    3. CIt outputs the contents of the array with the characters rearranged so they are no longer recognized as the words in the original phrase.
    4. DIt outputs the contents of the array in reverse order.

    Answer: (A) It outputs the contents of the array in the original order

    Explanation

    Sign in to read the full explanation
  144. Consider the midpoint (or Bresenham) algorithm for rasterizing lines given below :

    (1) Input (x1, y1) and (x2, y2)
    (2) y = y1
    (3) d = f(x1 + 1, y1 + 1/2) //f is the implicit form of a line
    (4) for x = x1 to x2
    (5) do
    (6) plot(x, y)
    (7) if(d < 0)
    (8) then
    (9) y = y + 1
    (10) d = d + (y1 – y2) + (x2 – x1)
    (11) else
    (12) d = d + (y1 – y2)
    (13) end
    (14) end

    Which statements are true?
    P : For a line with slope m > 1, we should change the outer loop in line (4) to be over y.
    Q : Lines (10) and (12) update the decision variable d through an incremental evaluation of the line equation f.
    R : The algorithm fails if d is ever 0.

    Choose the correct answer from the code given below :
    Code :

    1. AQ and R only
    2. BP and Q only
    3. CP, Q and R
    4. DP only

    Answer: (B) P and Q only

    Explanation

    Sign in to read the full explanation
  145. Which of the following HTML5 codes will affect the horizontal as well as vertical alignment of the table content ?

    1. A<td align=“middle” valign=“center”> BASH </td>
    2. B<td halign=“middle” valign=“center”> BASH </td>
    3. C<td style=“text-align : center; vertical-align : middle;”> BASH </td>
    4. D<td style=“horizontal-align : center; vertical-align : middle;”> BASH </td>

    Answer: (C) <td style=“text-align : center; vertical-align : middle;”> BASH </td>

    Explanation

    Sign in to read the full explanation
  146. Consider the following two C++ programs P1 and P2 and two statements S1 and S2 about these programs :

    P1:

    void f (int a, int * b, int & c)
    { a = 1; *b = 2; c = 3; }
    int main()
    { int i = 0; f(i, &i, i); cout << i; }
    

    P2:

    double a = 1, b = 2;
    double & f(double & d)
    { d = 4; return b; }
    int main()
    { f(a) = 5; cout << a << " : " << b; }
    

    S1 : P1 prints out 3
    S2 : P2 prints out 4 : 2

    What can you say about the statements S1 and S2 ?

    1. AOnly S1 is true
    2. BBoth S1 and S2 are true
    3. COnly S2 is true
    4. DNeither S1 nor S2 is true

    Answer: (A) Only S1 is true

    Explanation

    Sign in to read the full explanation

Frequently asked questions

How many Programming Languages and Computer Graphics questions have been asked in UGC NET Computer Science?

141 Programming Languages and Computer Graphics questions appear in the UGC NET Computer Science papers held between 2018–2026, and all of them are on this page with their answer key.

Are the answers on this page free?

Yes. Every question, its options, and the correct answer are free to read with no account. Signing in additionally unlocks the detailed explanation under each question.

Is Programming Languages and Computer Graphics an important topic for UGC NET Computer Science?

Programming Languages and Computer Graphics appears in every recent UGC NET Computer Science paper, across all 14 sittings covered here. Its share of the paper makes it worth revising thoroughly rather than sampling.

How should I practise Programming Languages and Computer Graphics after reading these questions?

Attempt the Programming Languages and Computer Graphics topic-wise sets, which put the same questions into a timed interface with instant scoring and weak-area analysis afterwards.

More Computer Science PYQs by topic

More Computer Science practice

Ready for a full paper?

Attempt Paper 1 + Paper 2 (Computer Science) together in a single timed session.

Full Mock Tests →