I would like to make the array contains random number in ascending order, for example (1,5,10...100), but not (5,1,10...). this code but when run the number not be ascending . what the error?
Random r=new Random();
int t=10;
int a[]=new int[t];
int count=0;
int end=0;
int curr=0;
while(count<t){
curr=r.nextInt();
end=end+curr;
count++;}
for(int i=0;i<to;i++){
a[i]=r.nextInt(10);}
```