You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
void main()
{ clrscr();
int p[20],i,k,n;
cout<<"\nEnter no. of process\n";
cin>>n;
p[0]=0;
cout<<"\nEnter process time in ascending order\n";
for(i=1;i<=n;i++)
{
cin>>p[i];
}
cout<<"\nWhat is the position of head\n";
cin>>i;
cout<<"\nSequence of processes is:\n" ;
for(k=i;k>=1;k--)
{
cout<<"p["<<k<<"]--->";
}

for(k=n;k>i+1;k--)
{ cout<<"p["<<k<<"]--->";
}
cout<<"p["<<i+1<<"]";

getch();
}

You might also like