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. Match the LIST-I with LIST-II LIST-I LIST-II A. long signed int I. %lf B. double II. %Lf C. long double III. %c D. unsigned character IV. %ld Choose the correct answer from the options given below:
    Answer: B. A-IV, B-I, C-II, D-III Paper 2 CS · 22 June 2026
  2. Which of the following are correct about constructors in C++? 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.…
    Answer: B. A, C & D only Paper 2 CS · 22 June 2026
  3. Arrange the following data types in non-decreasing order according to the length of their representation in C++. A. char B. int C. float D. double Choose the correct answer from the options given below:
    Answer: D. A, B, C, D Paper 2 CS · 22 June 2026
  4. Which of the following would be the value of z for the C program code? x = 16; y = 4; z = x >> y;
    Answer: D. 1 Paper 2 CS · 22 June 2026
  5. What will be the output of the following program? #include<stdio.h> int main() { int i; for (i = 0; i++<10; ) printf("%d", i++); return 0; }
    Answer: C. 1 3 5 7 9 Paper 2 CS · 22 June 2026
  6. Match the LIST-I with LIST-II. LIST-I LIST-II A. Pivot point I. Reflection B. Fixed point II. Shear C. Mirror image III. Rotation D. Distortion IV. Scaling Choose the correct answer from the options given below:
    Answer: A. A-III, B-IV, C-I, D-II Paper 2 CS · 22 June 2026
  7. The number of pixel columns divided by the number of scan lines that can be displayed by the system, is called
    Answer: C. Aspect ratio Paper 2 CS · 22 June 2026
  8. The above figure shows a triangle at an original position (vertices labelled 2, 1, 3) to the left of the y-axis, and the same triangle, filled/hatched, at a reflected position (vertices labelled 2, 1, 3) to the right of…
    Answer: C. B, C only Paper 2 CS · 22 June 2026
  9. What will be the output of the following C programming code:int i, j; for(i=1; i<5; i+=2) for(j=1; j<i; j+=2) printf("%d", j);
    Answer: A. 1 Paper 2 CS · June 2025
  10. What would be the equivalent pointer expression for referring the array element ar[m][n][0]?
    Answer: D. *(*(*(ar + m) + n) + 0) Paper 2 CS · June 2025
  11. Which of the following techniques is used for Clipping?
    Answer: C. Sutherland-Cohen Paper 2 CS · June 2025
  12. Consider the following piece of C programming code:int x=128, y=110; do { if(x>y) x=x-y; else y=y-x; } while(x!=y); printf("%d",x); Which one will be the output?
    Answer: B. 2 Paper 2 CS · June 2025
  13. Match List I with List IIList I List II A. Overloading I. Since function call is resolved during run time, the execution is slow. B. Early binding II. Since function call is resolved during compilation time, the executi…
    Answer: C. A-III, B-II, C-IV, D-I Paper 2 CS · June 2025
  14. Consider the following statements for XML (Extensible Markup Language): A. The number of tags decreases and users can define their own tags. B. It is used for Presentation. C. It is case sensitive. D. It is dynamic. Whi…
    Answer: C. A, C, D Only Paper 2 CS · June 2025
  15. Match List I with List IIList I List II A. Oblique Projection I. When the direction of projection is so chosen that the lines perpendicular to the plane of projection are foreshortened. B. Cavalier Projection II. When t…
    Answer: B. A-IV, B-II, C-I, D-III Paper 2 CS · June 2025
  16. What will be the output of the following C programming code:void main() { 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)); }
    Answer: B. 90 Paper 2 CS · June 2025
  17. Only legal pointer operations: A. pointer + number → pointer B. pointer − number → number C. pointer + pointer → pointer D. pointer − pointer → pointer E. pointer − pointer → number Choose the most appropriate answer fr…
    Answer: D. A, E Only Paper 2 CS · June 2025
  18. Consider the operators used in C Programming given below: A. && B. += C. >> D. >= E. ?: Choose the correct order of precedence of the operators given above (higher to lower):
    Answer: C. C, D, A, E, B Paper 2 CS · June 2025
  19. Consider the conditional statement if (m == 20 − 10 || n > 10). The order of execution of the following operations is A. == B. − C. || D. > Choose the correct answer from the options given below:
    Answer: C. B, D, A, C Paper 2 CS · December 2024
  20. Which of the following is NOT true about Global Variables?
    Answer: D. A function that uses global variables does not suffer from reusability. Paper 2 CS · December 2024
  21. 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 world-c…
    Answer: C. C, A, B, D Paper 2 CS · December 2024
  22. The entire set of parameters, including the return address, that is stored for a procedure invocation is referred to as
    Answer: A. stack frame Paper 2 CS · December 2024
  23. Consider the following statements:int x = 10, y = 15; x = ((x == y) ? (y + x) : (y - x)); What will be the value of x after executing these statements?
    Answer: A. 5 Paper 2 CS · December 2024
  24. 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 Choose the correct answe…
    Answer: B. A, B & C only Paper 2 CS · December 2024
  25. Match List I (Functions) with List II (Uses of functions)List I List II A. fseek() I. Gives the current position in the file B. ftell() II. Sets the position to the beginning of the file C. feof() III. Sets the position…
    Answer: B. A-III, B-I, C-IV, D-II Paper 2 CS · December 2024
  26. Which of the following statements is NOT true?
    Answer: C. The scope resolution operator (::) can be overloaded like normal operators. Paper 2 CS · December 2024
  27. The light given off by the phosphor during exposure to the electron beam is known as
    Answer: A. Fluorescence Paper 2 CS · December 2024
  28. 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 expr…
    Answer: B. (A) and (B) Only Paper 2 CS · June 2024 Re-Exam
  29. 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 will * be printed if the function is called with Cal(10, 10)?
    Answer: D. 27 Paper 2 CS · June 2024 Re-Exam
  30. Which of the following is the correct way to declare a function pointer in C?
    Answer: B. int (*func) (int, int); Paper 2 CS · June 2024 Re-Exam