please help me debug this round robin implementation

This is the code for implementing the round robin algorithm in c++
I am trying to display the list of processes based on remaining time.
this program runs twice and then displays a wrong remtime...can anyone help me here?

-------
#include<iostream>
using namespace std;

int main()
{

int remtime[3],quantum=2,bu[3],remtime_n[3] ,i ;
for(int i=0;i<2;i++)
{
cout<<"Enter burst time for process:"<<i+1<<"\t";
cin>>bu[i];
cin.get();
remtime[i]=bu[i]-quantum;
}
int j;

for(j=0;j<3;j++)
{
for(i=0;i<2;i++)
{
if(remtime[i]<quantum)
cout<<"for process"<< i+1 <<" last run" <<endl;

else if(remtime[i]=0)
cout<<"This process is done"<<endl;

else
cout<<"Process "<< i+1<< "is running"<<endl;
}
for(i=0;i<2;i++){
remtime_n[i]=remtime[i]-quantum;
cout<<"now Remaining time is "<<remtime[i];
}
cin.get();
}

}

---------------------
Topic archived. No new replies allowed.