Operating System homework Help at TutorEye

## Top Questions

the section tags. Thank you in advance.
View More

. I'm really close to completing it and I'm really stuck on this one situation and I don't know how to solve it. So right now I'm making a guessing game and every time you play the program tells the user how many guesses it took for them to get the answer. And what I need to do is to make sure that I get and isolate the lowest amount of guess and put it into the statistics function so that way it can print out the lowest amount of guesses that I got. Right now it isn't working and I really don't know why as it seems to be mostly adding up all the guesses until the last few. Here's my code: #include #include #include #include void haiku(){ printf("Welcome to the game.\n"); printf("Guess a number within range.\n"); printf("Win cool prizes here.\n\n"); } int compare(int guessiso){ int lowestvalue=0; int biggervalue=0; if(guessisooperand){ printf("It's lower.\n"); count++; isolatedcount++; } else if(user0){ lowguess=compare(x); x=one_game(count); count=x; printf("Do you want to play again?\n"); scanf("%d",&usertwo); userthree=usertwo; gamecount++; } statistics(gamecount,x,lowguess); }
View More

## Operating System:

Operating System is system software and is used to manage resources (both software and hardware) moreover, it provides services to the computer programs. It acts as an interface between the user and computer hardware. Some common examples of Operating systems are Microsoft Windows, Android, iOS, Linux, etc.

## Operating System Sample Questions:

Question 1: Which of the following is not true about Kernel in the context of an Operating System?

A) It is responsible for managing system resources

B) It acts as a bridge between computer hardware and application

D) None of these

Explanation: The following statements are true about kernel in the context of an Operating System:
It is responsible for managing system resources
It acts as a bridge between computer hardware and application
It is one of the first programs to load on the startup but loaded after the bootloader
It manages system resources

Question 2: Which of the following system call can create a new process in Unix?

A) new

B) create

C) fork

D) None of these

Explanation: In Unix, fork() system call can be used to create a new process. It returns the Process ID of the child process which is created.

Question 3: Which of the following is not contained in the process stack?

A) Program Instructions

B) Function Parameters

C) Local Variables which are declared inside the function

D) None of these

Explanation: Process stack contains:
Local Variables which are declared inside the function
Function Parameters
Dynamically allocated memory
Global variables
Program Instructions

Question 4: Which of the following is a valid reason for using a scheduling algorithm?

A) For increasing turnaround time

B) For increasing response time

C) For increasing waiting time

D) None of these

Explanation: Valid reasons for using scheduling algorithm:
For decreasing turnaround time
For decreasing response time
For decreasing waiting time

Question 5: Which of the following is true about round robin?

A) It is a preemptive scheduling algorithm

B) As compared to FCFS it has more response time

C) For a long time quantum value, Round Robin behaves like FCFS

D) None of these

Answer: As compared to FCFS it has more response time

Explanation: The following statements are true about the Round Robin scheduling algorithm:
It is a preemptive scheduling algorithm
As compared to FCFS, Round Robin has less response time if the time quantum is less. It is because it is preemptive.
For a long time quantum value, Round Robin behaves like FCFS

Question 6: Which scheduler is responsible for selecting the process from the ready queue and scheduling it on the running state?

A) Short Term Scheduler

B) Long Term Scheduler

C) Medium Term Scheduler

D) All of these

Explanation: Short Term Scheduler: It is responsible for selecting the process from the ready queue and scheduling it on the running state
Long Term Scheduler: It is responsible for bringing new processes to the ready state
Medium Term Scheduler: It is responsible for suspending and then resuming the process

Question 7: Which of the following is not a process state?

A) New

B) Wait

D) None of these

Explanation: There are the following valid states a process can have:
New
Running
Terminate
Wait / Block
Suspend Block

Question 8: The Process Control Block is a?

A) Data Structure

B) Variable of type process

C) A block in the memory

D) None of these

Explanation: Process Control Block is a Data Structure used by the Operating System to store all the information about a process.

Question 9: In which of the following cases in dining philosophers problem deadlock will occur?

A) 5 chopsticks and 6 philosophers

B) 5 chopsticks and 5 philosophers

C) 5 chopsticks and 7 philosophers

D) None of these

Answer: 5 chopsticks and 5 philosophers

Explanation: Each philosopher will have one chopstick and will wait for neighbours to release a chopstick, this will cause a deadlock.

Question 10: Semaphores are used to implement which of the following?

A) Interprocess Communication mechanisms

B) System Protection

C) System Calls

D) None of these

Explanation: Semaphores are used to implement Interprocess Communication mechanisms and are capable of solving mutual exclusion, race condition, and process synchronization.