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

Programming Languages and Computer Graphics — Mock Test 6

25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.

0 / 25 answered 00:00
Q1. (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?
Q2. (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 ____.
Q3. (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.
Q4. 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 with the FIFO and LRU page-replacement algorithms respectively (assuming enough space for storing 3 page frames), then (P, Q) = ____.
Q5. 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?
Q6. Which of the following is incorrect for virtual memory?
Q7. 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:
Q8. 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.
Q9.

What would be the equivalent pointer expression for referring the array element ar[ m ][ n ][0]

Q10.

Which of the following technique is used for Clipping?

Q11.

Match List I with List II

Figure
Figure
Q12.

Match List I with List II

Figure
Figure
Q13.

Only legal pointer operations: →

A. pointer + number pointer →

B. pointer - number number →

C. pointer + pointer pointer →

D. pointer - pointer pointer →

E. pointer - pointer number

Q14.

Consider the conditional statement if (m == 20 − 10 || n > 10). The order of execution of the following operations is: A. == B. − C. || D. >

Q15.

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 world - coordinates scene using modeling - coordinates transformations

D. Map normalized viewpoint to device coordinates

Choose the correct answer from the options given below:

Q16.

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

Q17.

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 position to a desired point in the file; IV. Used to test for an end-of-file condition.

Q18.

Which of the following statement is not True?

Q19.

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 expression

(D) Pointers cannot be used to access structure members

Q20.

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.

Q21.
#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;
}
Q22.
#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?

Q23.

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

Q24.
#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?

Q25.

Which of the following is not an object Oriented Programming language ?