All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 03

Programming Languages and Computer Graphics – Previous Year Questions

229 questions from past UGC NET Paper 2 – Computer Science papers, each with the correct answer. Open any question for its explanation.

  1. Which of the following 2-D transformations is used to resize a 2-dimensional object?
    Answer: C. Scaling Paper 2 CS · June 2023
  2. 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); }
    Answer: D. Illegal use of pointer in main function Paper 2 CS · June 2023
  3. Which of the following is NOT an object-oriented programming language?
    Answer: D. SQL Plus Paper 2 CS · June 2024 (Cancelled Exam)
  4. What is the output of the following C program?#include <stdio.h> int main(void) { int x, *p; x = 30; p = x; printf("%d", *p); return 0; }
    Answer: D. Error Paper 2 CS · June 2024 (Cancelled Exam)
  5. Multiple inheritance is permitted directly in: A. C++ B. Java C. Python D. VB.NET E. BASIC Choose the most appropriate answer from the options given below:
    Answer: B. A and C Only Paper 2 CS · June 2024 (Cancelled Exam)
  6. Which of the following are markup languages? A. HTML B. XML C. DHTML D. LML E. PML Choose the correct answer from the options given below:
    Answer: D. A, B, C Only Paper 2 CS · June 2024 (Cancelled Exam)
  7. Arrange the following in the correct order so that they follow a proper run-time environment. A. Programming statement B. Compilation C. Memory allocation D. Type of variable E. Memory deallocation Choose the correct an…
    Answer: B. A, B, D, C, E Paper 2 CS · June 2024 (Cancelled Exam)
  8. Match List I with List IIList I List II A. Union I. Virtual Reality B. Function II. Shadow mask C. Interactive Environment III. Subroutine D. Output device IV. User-defined data type
    Answer: A. A-IV, B-III, C-I, D-II Paper 2 CS · June 2024 (Cancelled Exam)
  9. Which of the following algorithms are used for line drawing? A. DDA algorithm B. Bresenham algorithm C. Mid-point algorithm D. Curve algorithm Choose the most appropriate answer from the options given below:
    Answer: C. A and B Only Paper 2 CS · June 2024 (Cancelled Exam)
  10. The least values of signed and unsigned 8-bit data-type variables would be:
    Answer: D. −128, 0 Paper 2 CS · June 2024 (Cancelled Exam)
  11. In the context of binding, which one of the following is incorrect?
    Answer: C. Internal functions are known at link time Paper 2 CS · December 2022 Shift 1
  12. 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 the element 1 in the above 3-D array?
    Answer: B. *(*(*(arr + 2) + 3) + 1) Paper 2 CS · December 2022 Shift 1
  13. Allowing different derived classes to be used interchangeably through the interface provided by a common base class is called ______
    Answer: D. Run-time polymorphism Paper 2 CS · December 2022 Shift 1
  14. In a ______ curve the first and last vertices of the control polygon lie on the curve, and all other vertices define the derivatives, order and shape of the curve.
    Answer: C. Bezier curve Paper 2 CS · December 2022 Shift 1
  15. 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:
    Answer: C. B, C, D only Paper 2 CS · December 2022 Shift 1
  16. Which of the following are correct uses of std::string constructors? 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 be…
    Answer: A. A, B, D, E only Paper 2 CS · December 2022 Shift 1
  17. A corporate website's appearance varies according to the department that owns the documents, but all documents follow the corporate look and feel. The HR department does not need a separate style sheet; it needs only a…
    Answer: B. B, C Only Paper 2 CS · December 2022 Shift 1
  18. Match List I with List IIList I List II A. 2-D Array Input I. Liquid Crystal Display B. Transmissive device II. Flat-bed scanner C. Binary image III. Camera D. 1-D Array input IV. Inkjet printer
    Answer: B. A-III, B-I, C-IV, D-II Paper 2 CS · December 2022 Shift 1
  19. 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 re…
    Answer: B. x <= 25 Paper 2 CS · December 2022 Shift 2
  20. Machine level language is a/an
    Answer: B. Low-level language Paper 2 CS · December 2022 Shift 2
  21. Which of the following is wrong about data types?
    Answer: C. The range of values for signed data types is more than that of unsigned data ty… Paper 2 CS · December 2022 Shift 2
  22. If a constructor 'Date' is declared explicit and has to be defined outside the class, which of the following is correct?
    Answer: A. Date::Date(int dd) { /* ... */ } Paper 2 CS · December 2022 Shift 2
  23. Which one of the following allows the session to continue?
    Answer: D. When the user refreshes the browser and there is a persistent cookie Paper 2 CS · December 2022 Shift 2
  24. Given a vector with Cartesian components (x, y), if scaling is done with the matrix [[0.5, 0], [0, 1.5]], which of the following are true? 1. Decreases the vertical by three halves 2. Increases the vertical by three hal…
    Answer: D. 2 and 4 only Paper 2 CS · December 2022 Shift 2
  25. Which of the following lists defined in HTML share a similar element? 1. Unordered lists 2. Ordered lists 3. Definition lists 4. Correlated lists 5. Enumerated lists Choose the most appropriate answer from the options g…
    Answer: A. 1, 2 only Paper 2 CS · December 2022 Shift 2
  26. Match List I with List II. Choose the correct answer from the options given below:List I List II a. If the implementation of generated or derived classes differs only through a parameter, we have I. to use a class hiera…
    Answer: B. a-III, b-I, c-II, d-IV Paper 2 CS · December 2022 Shift 2
  27. In what sequence are initialisation, testing and execution of the body done in a do-while loop? I. Commenting II. Execution of the body III. Initialisation IV. Testing the condition
    Answer: D. III, II, IV Paper 2 CS · December 2022 Shift 2
  28. Assertion A: A raster-scan device is a CRT graphics device and can use a television monitor for display. Reason R: In a raster-scan display the picture is composed of a series of dots traced out as horizontal lines. Tel…
    Answer: A. Both A and R are true and R is the correct explanation of A Paper 2 CS · December 2022 Shift 2
  29. The hidden-surface removal problem with a minimal 3D pipeline can be solved with
    Answer: A. Painter's algorithm Paper 2 CS · September 2022
  30. The condition num != 65 cannot be replaced by
    Answer: D. !(num − 65) Paper 2 CS · September 2022