Practise 42 Programming Languages and Computer Graphics questions asked in UGC NET Computer Science from 2020–2025. 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.
Practise Programming Languages and Computer Graphics as timed sets
Focused 10-question sets with instant scoring, explanations, and weak-area analysis.
Ordered newest exam first. Each question links back to the full paper it came from.
Which statement is not true about global variables?
Answer: (D) A function that uses global variables does not suffer from reusability.
Explanation
The light given off by a phosphor during exposure to an electron beam is known as
Answer: (A) Fluorescence
Explanation
Match C file functions with their uses.
| List-I | List-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 |
Answer: (B) A-III, B-I, C-IV, D-II
Explanation
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.
Answer: (C) C, A, B, D
Explanation
Consider the conditional statement if (m == 20 - 10 || n > 10). What is the order of execution of the following operations?
A. ==
B. -
C. ||
D. >
Answer: (C) B, D, A, C
Explanation
Which of the following statements is not true?
Answer: (C) The scope-resolution operator (::) can be overloaded like normal operators.
Explanation
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
Answer: (B) A, B and C only
Explanation
Consider:
int x = 10, y = 15;
x = ((x = y) ? (y + x) : (y - x));
What is the value of x after execution?
Answer: (D) 30
Explanation
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
Answer: (B) (A) and (B) Only
Explanation
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); ?
Answer: (D) 27
Explanation
Which of the following is correct way to declare a
functional pointer in C ?
Answer: (B) int (*func) (int, int);
Explanation
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
?
Answer: (D) 10
Explanation
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.
Answer: (D) (A), (B) Only
Explanation
#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?
Answer: (A) ONE TWO TWO ONE
Explanation
Which of the following C++ statements correctly
declares an abstract class ?
Answer: (A) class A { virtual void show ()=0 ; };
Explanation
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 |
Answer: (C) (A)-(IV), (B)-(I), (C)-(II), (D)-(III)
Explanation
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.
Answer: (B) (A) and (D) Only
Explanation
#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?
Answer: (A) 5, 10
Explanation
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;
}
Answer: (A) Base Const Derived Const Derived dest Base dest
Explanation
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 :
Answer: (B) 4
Explanation
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
Answer: (C) (C), (D), (B), (A)
Explanation
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));
}
Answer: (B) 20 50
Explanation
#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?
Answer: (B) 1,3
Explanation
A program that is used by other routines to accomplish a particular task, is called :
Answer: (D) Subroutine
Explanation
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 :
Answer: (B) (—30, —12), Q(—22, —4) and R(10, 4)
Explanation
Which of the following statements is TRUE ?
Answer: (C) We can never build an object from a class containing a pure virtual function
Explanation
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); }
Answer: (C) 999-1
Explanation
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 :
Answer: (D) synchronous bus
Explanation
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 :
Answer: (C) (A) and(B) Only
Explanation
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 :
Answer: (B) (A), (© and (D) Only
Explanation
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) |
Answer: (C) 4
Explanation
Match List-I with List-II.
| Source matching prompt | Source values |
|---|---|
| See question stem | See answer choices |
Answer: (A) (A), (B)-V), ©)-(, (P)-CI)
Explanation
Match List-I with List-II.
| Source matching prompt | Source values |
|---|---|
| See question stem | See answer choices |
Answer: (A) (A), (B)-(), (©-€V), (D)-()
Explanation
In HTML, the <map> tag is used for
Answer: (B) defining clickable regions in an image
Explanation
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; }
Answer: (C) 240 bytes
Explanation
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)?
Answer: (A) 0.2
Explanation
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.
Answer: (C) (B) and (C) only
Explanation
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.
Answer: (A) (A) and (B) only
Explanation
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.
Answer: (C) (B) and (C) only
Explanation
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 I | List II |
|---|---|
| Items are listed in the question stem. | Match each item to its stated description or complexity. |
Answer: (D) OCR review required
Explanation
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.
Answer: (C) D, C. B.A (2) B,C,D.A
D,C, A,B (4) C,D,BA
Explanation
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
Answer: (D) Statement I is incorrect but Statement II is true.
Explanation
42 Programming Languages and Computer Graphics questions appear in the UGC NET Computer Science papers held between 2020–2025, and all of them are on this page with their answer key.
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.
Programming Languages and Computer Graphics appears in every recent UGC NET Computer Science paper, across all 4 sittings covered here. Its share of the paper makes it worth revising thoroughly rather than sampling.
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.
Ready for a full paper?
Attempt Paper 1 + Paper 2 (Computer Science) together in a single timed session.