System Programs

System programs provide a convenient environment for program development & execution. They are divided into the following categories. File manipulation: These programs create, delete, copy, rename, print & manipulate files and directories. Status information: Some programs ask the system for date, time & amount of available memory or disk space, no. of users or similar […]

System Calls

System calls provide the interface between a process & the OS. These are usually available in the form of assembly language instruction. Some systems allow system calls to be made directly from a high level language program like C, BCPL and PERL etc. systems calls occur in different ways depending on the computer in use. […]

Basic Functions of Operation System

The various functions of the operating system are as follows: 1. Process Management: A program does nothing unless its 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 […]

Write a C program to read name and marks of n number of students from user and store them in a file. If the file previously exits, add the information of n students

#include <stdio.h> int main() { char name[50]; int marks, i,n; printf(“Enter number of students”); scanf(“%d”, &n); FILE *fptr; fptr=(fopen(“C:\\student.txt”,”a”)); if (fptr==NULL){ printf(“Error!”); exit(1); } for(i=0;i<n;++i) { printf(“For student%d\nEnter name: “,i+1); scanf(“%s”,name); printf(“Enter marks”); scanf(“%d”, &marks); fprintf(fptr, “\nName: %s\nMarks=%d\n”, name, marks); } fclose(fptr); Return 0; } The fclose function causes the stream pointed to be flushed […]

Program for multiplication of two matrices

#include <stdio.h> int main() { int a[10][10], b[10][10], result[10][10]; int i, j, k, r1, c1, r2, c2; // Input rows and columns for first matrix printf(“Enter rows and columns for first matrix: “); scanf(“%d %d”, &r1, &c1); // Input rows and columns for second matrix printf(“Enter rows and columns for second matrix: “); scanf(“%d %d”, […]