C program to demonstrate assert macro.

Write a C program to demonstrate assert macro.assert macro defined in assert.h library. assert is mainly used for debugging. assert function checks the conditions at run time, and program executes only if the assert is true otherwise program aborts and shows the error message.Read more about C Programming Language . and read the C Programming …

C program to implement SJF algorithm.

Write a C program to implement SJF algorithm.Shortest Job First(SJF) is the CPU scheduling algorithm. In SJF, if the CPU is available it allocates the process which has smallest burst time, if the two process are same burst time it uses FCFS algorithm.Read more about C Programming Language . and read the C Programming Language …

C Program to implement FCFS algorithm.

Write a C Program to implement FCFS algorithm.First Come First Served(FCFS) algorithm is the CPU scheduling algorithm. In FCFS process is served when they are arrived in order, i.e First In First Out(FIFO). FCFS is the simple scheduling algorithm, but it takes typically long/varying waiting time.Read more about C Programming Language . and read the …

K&R C Chapter 4 Exercise Solutions — Functions and Program Structure

Chapter 4: Functions and Program Structure is where K&R builds a non-trivial program: a reverse Polish notation (RPN) calculator. The exercises extend it — adding modulo, unary minus, variables, and last-printed-value recall. Other exercises cover recursive printd, recursive itoa, and the C preprocessor. Exercise 4-12 (recursive itoa) and 4-13 (recursive reverse) are elegance tests. These …

C Program to solve equations using Jordan elimination method.

Write a C Program to solve equations using Jordan elimination method.Gauss-Jordan elimination method is used to solve the linear equations. In this method, We find the inverse matrix of the coefficients of equations by elementary row operations. Read more about C Programming Language . and read the C Programming Language (2nd Edition) by K and …

C Program to lock file using semaphores.

Write a C Program to lock file using semaphores.Using semaphores, We can control access to files, shared memory and other things. The basic functionality of a semaphore is that you can either set it, check it, or wait until it clears then set it (“test-n-set”). In C semaphores functions defined in the sys/sem library. Read …