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.
- Which of the statement is not true in regards to virtual memory? (i) The main objective for using virtual memory is to increase the effective capacity of the memory system. (ii) Size of the program can be as large as th…
- For the following page reference string: 4, 3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5 — the number of page faults that occur using the Least Recently Used (LRU) page replacement algorithm with frame size 3 is:
- Given memory access time as p nanoseconds and an additional q nanoseconds for handling a page fault, what is the effective memory access time if a page fault occurs once for every 100 instructions?
- Consider a machine with 16 GB of main memory and a 32-bit virtual address space, with page size 4 KB (frame size equals page size). If a process of size 34 KB is to be executed on this machine, what will be the size of…
- (Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) What is the size of the page table needed to handle the given virtual address space, given that each page table entry is of size…
- (Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) What is the minimum number of bits needed for the physical address?
- (Same machine as above: 16 GB main memory, 32-bit virtual address space, 4 KB page size.) The number of bits reserved for the frame offset is ____.
- (Same machine as above: 32-bit virtual address space, 4 KB page size.) Find the number of pages required for the given virtual address space.
- Consider a hypothetical machine with 3 pages of physical memory, 5 pages of virtual memory, and as the stream of page references by an application. If P and Q are the number of page faults the application would incur wi…
- For the page reference string 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 with 3 page frames (initially empty), which page replacement algorithm produces the minimum number of page faults?
- Which of the following is incorrect for virtual memory?
- A memory management system has 64 pages with a page size of 512 bytes. Physical memory consists of 32 page frames. The number of bits required in the logical and physical addresses are respectively:
- Consider the page-reference string: 0 1 2 3 0 1 4 0 1 2 3 4. If the FIFO page-replacement algorithm is used, find the number of page faults for (a) 3 page frames and (b) 4 page frames, respectively.
- What would be the equivalent pointer expression for referring the array element ar[ m ][ n ][0]
- Which of the following technique is used for Clipping?
- Match List I with List II
- Match List I with List II
- Only legal pointer operations: → A. pointer + number pointer → B. pointer - number number → C. pointer + pointer pointer → D. pointer - pointer pointer → E. pointer - pointer number
- Consider the conditional statement if (m == 20 − 10 || n > 10). The order of execution of the following operations is: A. == B. − C. || D. >
- Arrange the 2-D viewing transformation pipeline. A. Convert world-coordinates to viewing coordinates B. Map viewing coordinates to normalized viewing coordinates using window - viewpoint specifications C. Construct worl…
- 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
- Match List I (functions) with List II (uses). List I: A. fseek(), B. ftell(), C. feof(), D. rewind(). List II: I. Gives the current position in the file; II. Sets the position to the beginning of the file; III. Sets the…
- Which of the following statement is not True?
- 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 deferenced in expres…
- 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…
- #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 ",…
- #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?
- 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
- #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?
- Which of the following is not an object Oriented Programming language ?