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 Encrypt and Decrypt a password

C Strings:Write a C program to Encryption and Decryption of password.In this program we encrypt the given string by subtracting the hex value from it. Password encryption is required for the security reason, You can use so many functions like hash or other keys to encrypt. Read more about C Programming Language . and read …

C Program to solve the producer consumer problem

C Program to Solve the Producer-Consumer Problem Using Semaphores The producer-consumer problem (also called the bounded-buffer problem) is a classic process synchronization problem. A producer process generates data items while a consumer process reads them; a semaphore enforces the ordering so the consumer never reads ahead of the producer. Note: This program uses POSIX System …

C Program to check matrix is magic square or not

A magic square is a square matrix in which the sum of every row, every column, and both main diagonals is the same number (called the magic constant). This C program reads a square matrix and checks whether it is a magic square. Example: 8 1 6 3 5 7 4 9 2 Every row, …

C Program to demonstrate strspn function.

Write a C Program to demonstrate strspn function.The strspn() function returns the index of the first character in string1 that doesn’t match any character in string2. If all the characters of the string2 matched with the string1, strspn returns the length of the string1. Read more about C Programming Language . /************************************************************ You can use …

C program to replace the sub string with another string.

C Strings:Write a C program to replace the sub string in a string with another string.In this program, We replace string with another string, if the entered string is the sub string of main string, otherwise function replace_str returns the original string as it is. Read more about C Programming Language . /************************************************************ You can …