3i Infotech Placement: Sample Questions 289 - 290 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 289

Edit

Describe in Detail

Essay▾

Find the output for the following C program

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

Explanation

  • In 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 290

Edit

Describe in Detail

Essay▾

What are short, long and medium-term scheduling?

Explanation

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.

Developed by: