program:
#include<iostream.h>
#include<conio.h>
void main()
{
int i,n,t[10],et[10],s=0,wt[10];
char name[10];
float avg;
clrscr();
cout<<"enter no of processors";
cin>>n;
cout<<"enter the name of each processors";
for(i=0;i<n;i++)
{#include<conio.h>
void main()
{
int i,n,t[10],et[10],s=0,wt[10];
char name[10];
float avg;
clrscr();
cout<<"enter no of processors";
cin>>n;
cout<<"enter the name of each processors";
for(i=0;i<n;i++)
cin>>name[i];
}
cout<<"\n entre time of each processors";
for(i=0;i<n;i++)
{
cin>>t[i];
}
for(i=0;i<n;i++)
{
wt[i+1]=wt[i]+t[i];
et[i]=wt[i]+t[i];
}
s=s+t[i];
avg=s/n;
cout<<"\n name\ttime\twtime\tetime\n";
for(i=0;i<n;i++)
{
cout<< name[i]<<"\t"<<t[i]<<"\t"<<wt[i]<<"\t"<<et[i]<<"\n";
}
getch();
}
No comments:
Post a Comment