3i Infotech Papers: Sample Questions 259 - 260 of 1245

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

Question number: 259

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

Find the output for the following C program

  1. main ()
  2. {
  3.     int x = 20y = 35;
  4.     x = y + + + x + +;
  5.     y = + + y + + + x;
  6.     printf ( “%d %d ” ,xy);
  7. }

Explanation

  • In the program

Table showing the program

Table showing the program

int x = 20, y = 35;

  • define the integer variable x = 20 and y = 35

x = y ++ + x ++;

  • here x = 35+++ 20++

x = 36 + 20

x = 56

y =+ + y ++ + x;

  • here x = 56

  • then y=++35 +++56

  • y = 36 + 57

  • y = 93

printf (“%d % d ”, x, y);

  • printf prints the value of x = 56 and y = 93

Question number: 260

» Basic CS » Operating System

Essay Question▾

Describe in Detail

What are short, long and medium-term scheduling?

Explanation

Long-term scheduler vs short-term scheduler

Long-Term Scheduler vs Short-Term Scheduler

Long-term scheduler vs short-term scheduler

Long Term Scheduler:

  • Also called job scheduler.

  • Determines programs admitted to system for processing.

  • Selects processes from the queue and loads into memory for execution.

  • Processes load into the memory for CPU scheduling.

Short Term Scheduler:

  • Also called CPU scheduler.

  • Increase system performance based on chosen criteria.

  • Changes ready state to running state of the process.

  • Faster than long-term schedulers.

Medium Term Scheduler:

  • A part of swapping.

  • Removes the processes from the memory.

  • Reduces the degree of multiprogramming.

  • Running process may become suspended if it makes an I/O request.