Program to print the sum of 1st N natural numbers

What are Natural Numbers? Natural numbers are positive integers starting from 1, 2, 3, and so on. The sum of the first N natural numbers can be calculated using a loop or using the formula: Sum = n(n+1)/2 #include<stdio.h> int main() { int n,i,sum=0; printf(“Enter the limit: “); scanf(“%d”, &n); for(i=1;i<=n;i++) { sum = sum […]

Basic Functions of Operation System

The various functions of operating system are as follows: 1. Process Management: A program does nothing unless their instructions are executed by a CPU.A process is a program in execution. A time shared user program such as a compiler is a process. A word processing program being run by an individual user on a pc […]

Top 10 Cyber Crime Prevention Tips

1. Use Strong Passwords Use different user ID / password combinations for different accounts and avoid writing them down. Make the passwords more complicated by combining letters, numbers, special characters (minimum 10 characters in total) and change them on a regular basis. 2. Secure your computer Activate your firewall Firewalls are the first line of […]

Computer security

Computer security is security applied to computing devices such as computers and smartphones, as well as computer networks such as private and public networks, including the whole Internet. The field covers all the processes and mechanisms by which digital equipment, information and services are protected from unintended or unauthorized access, change or destruction, and are […]

Recovery from Deadlock

When a detection algorithm determines that a deadlock exists, several alternatives exist. One possibility is to inform the operator that a deadlock has occurred, and to let the operator deal with the deadlock manually. The other possibility is to let the system recover from the deadlock automatically. There are two options for breaking a deadlock. […]

Safety Algorithm

1. Let Workand Finish be vectors of length m and n, respectively. Initialize: Work = Available Finish [i] = false for i = 0, 1, …,n- 1. 2. Find and i such that both: (a) Finish [i] = false (b) Needi Work If no such i exists, go to step 4. 3. Work = Work […]

Banker’s Algorithm

This algorithm can be used in banking system to ensure that the bank never allocates all its available cash such that it can no longer satisfy the needs of all its customer. This algorithm is applicable to a system with multiple instances of each resource type. When a new process enter in to the system […]

Deadlock Prevention

Deadlock prevention is a set of methods for ensuring that at least one of these necessary conditions cannot hold. Mutual Exclusion: The mutual exclusion condition holds for non sharable. The example is a printer cannot be simultaneously shared by several processes. Sharable resources do not require mutual exclusive access and thus cannot be involved in […]