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

Edit

Describe in Detail

Essay▾

What are the criteria for choosing a process for swapping out of the memory to the swap device?

Explanation

Swapping Process Out
  • 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

Edit

Describe in Detail

Essay▾

Define namespace?

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.
Define the How to Use the Namespaces in C ++

Question 381

Edit

Describe in Detail

Essay▾
  1. main ()
  2. {
  3.     staticcharnames[5][20] ={ “pascal” “ada” “cobol” “fortran” “perl” };
  4.     inti;
  5.     char ⚹t;
  6.     t =names[3];
  7.     names[3] =names[4];
  8.     names[4] =t;
  9.     for (i =0; i ⇐ 4; i ++ )
  10.     printf ( “%s” names[i]);
  11. }

Explanation

  • In a program ,
Table Shows the 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

Developed by: