answersLogoWhite

0

#include #include #include void main() { char p[10][5],temp[5]; int tot=0,wt[10],pt[10],i,j,n,temp1; float avg=0; clrscr(); printf("enter no of processes:"); scanf("%d",&n); for(i=0;i\n",i+1); scanf("%s",&p[i]); printf("enter process time"); scanf("%d",&pt[i]); } for(i=0;ipt[j]) { temp1=pt[i]; pt[i]=pt[j]; pt[j]=temp1; strcpy(temp,p[i]); strcpy(p[i],p[j]); strcpy(p[j],temp); } } } wt[0]=0; for(i=1;i\t P_time\t w_time\n"); for(i=0;i\t%d\t%d\n",p[i],et[i],wt[i]); printf("total waiting time=%d\n avg waiting time=%f",tot,avg); getch(); }

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the efficiency of the C scan algorithm for disk scheduling?

The efficiency of the C-scan algorithm for disk scheduling is considered to be high. It is a variant of the scan algorithm that improves performance by reducing the seek time of the disk arm. The C-scan algorithm scans the disk in one direction only, which can lead to faster access times compared to other algorithms.


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


Can you give a C program about SJF algorithm?

no.


Program in c to develop an algorithm that prints the n value of algorithm?

reymond rillera reymond rillera


How does algorithm and c plus plus program get along?

They are bosom-friends.


C program algorithm for simple interest using while loop?

Not used


Can someone provide the C program for Prim's algorithm?

The C code for Prim's algorithm can be found in the following link. https://sites.google.com/site/itstudentjunction/lab-programming-solutions/data-structures-programs/program-to-find-minimal-spanning-tree-using--prims-algorithm


What is solution in c program?

The program itself is the solution. All programs are a solution to a given problem; that's the entire point of writing a program, to solve a problem. The program's algorithm specifies how the problem is solved and it's the programmer's job to convert that algorithm into working code.


How do you RSA algorithm c?

Perform encryption on the following PT using RSA and find the CT p = 3; q = 11; M = 5


Write a c program to find smallest among three using function with pointers?

Please visit http://talentsealed.blogspot.com/2009/10/to-find-smallest-among-three-using.htmlfor answer.


Algorithms to the given c plus plus programs?

The question is impossible to answer. You cannot determine an algorithm from a given program if the program is not actually given in the question. Please place the program in the discussion section.


Does every algorithm have a c program?

Yes. More generally, every algorithm (defined as a sequence of finite steps to solve a problem that can be easily understood by a human) can be converted into machine code such that the algorithm can be understood by a machine. The C programming language is just one such method of converting algorithms into working machine code.