#include <iostream>
using namespace std;
int main()
{
clrscr();
int n,a[4],b[4],i,j;
float k;
cout<<"Enter no. of process :";
cin>>n;
for(i=0;i<n;i++)
{
cout<<"Enter burst time of process "<<i+1<<" : ";
cin>>a[i];
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i]<a[j])
{
k=a[i];
a[i]=a[j];
a[j]=k;
}
}
}
k=0; b[0]=a[0];
for(i=1;i<n;i++)
{
b[i]=b[i-1]+a[i];
}
for(i=0;i<n-1;i++)
{k+=b[i];}
cout<<"\nAverage Waiting Time = "<<k/n;
}
Download Code::Blocks C++ Source Code Here
Fake
ReplyDeleteye bik gayi hy gormint
ReplyDeletedafa door
ReplyDelete