please where is the error in this code doesn't run

```
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int ages[1000];
int size=1000;
int i,a,b;
for( i=0;i<size;i++)
{
ages[i]=rand();
for( a=1;a<size;a++)
{
for( b=size-1;b>=a;b--)
{
if(ages[b-1]<ages[b])
{
i=ages[b-1];
ages[b-1]=ages[i];
ages[b]=i;
}
}
}
}
cout<<ages[i];
return 0;
}
```

Code indented and tags added. -Narue