3i Infotech Papers: Sample Questions 451 - 452 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 451

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

  1. main ()
  2. {
  3.     char s[ ] = “man
  4.     int i;
  5.     for (i = 0si ]; i + + )
  6.     printf ( “ %c%c%c%c” si ], * (s + i), * (i + s), i[s]);
  7. }

Explanation

  • In a program

Table shows the program

Table shows the program

char s [] = “man”

Character array

int i;

Index number

for (i = 0; s [i]; i ++)

Apply for loop for change the array value

  • Here s [i], * (s + i), * (i + s), i [s] are all different ways of expressing the same idea.

  • Generally array name is the base address, so here s is the base address.

  • i is the index number from the base address.

  • So, indirectly * is same as s [i].

  • i [s] may be different, but in the case of c it is same as s [i].

  • So, the first time going to loop print the mmmm.

  • Second time going to loop print the aaaa.

  • And third times going to loop print the nnnn.

Question number: 452

» Operating System » Unix

Essay Question▾

Describe in Detail

What is the difference between swapping and paging?

Explanation

Understanding paging.

Understanding Paging.

Understanding paging.

Understanding of swapping

Understanding of Swapping

Understanding of swapping

Difference between swapping and paging

Difference between swapping and paging

Swapping

Paging

Whole process is moved from the swap device to the main memory for execution.

The required memory pages are moved to main memory from the swap device for execution.

Process size is less than or equal to the main memory.

Process size does not matter.

Easier to implement and less overhead to the system.

Not easy to implement and more overhead to the system.

Less flexible than paging systems.

Provides greater flexibility in mapping the virtual address space into the physical memory of the machine.