3i Infotech Placement: Sample Questions 379 - 381 of 1245
Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.
Question 379
Describe in Detail Essay▾
What are the criteria for choosing a process for swapping out of the memory to the swap device?
EditExplanation
- The kernel gathers the page addresses of data at primary memory to be swapped out.
- Kernel copies the physical memory assigned to a process to the space allocated on the swap device.
- The mapping between physical memory and swap device is kept in page table entry.
Question 380
Explanation
- It is a feature in c ++ to minimize name collisions in the global name space.
- This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions.
- Compiler uses the namespace signature for differentiating the definitions.
Question 381
Describe in Detail Essay▾
main ()
{
static char names[5][20] ={ “pascal” “ada” “cobol” “fortran” “perl” };
int i;
char ⚹t;
t =names[3];
names[3] =names[4];
names[4] =t;
for (i =0; i ⇐ 4; i ++ )
printf ( “%s” names[i]);
}
Explanation
- In a program ,
static char names [5] [20] = { “pascal” “ada” “cobol” “fortran” “perl” } ; | Given the static character 2D array. |
int i; | Assign integer variable i. |
char ⚹ t; | Given the character pointer t. |
t = names [3] ; | Given the t = name [3] ; So, t = fortran |
names [3] = names [4] ; | Here name [3] = fortran so, fortran = names [4] ; |
names [4] = t; | Here names [4] = fortran So, fortran = t; |
for (i = 0; i ⇐ 4; i ++) printf ( “% s” names [i] ) ; | Apply for loop And print names [i] But, Array names are pointer constant So, they can՚t be modified |
- So the answer is Compiler error: L value required in function main