This seems to be a very simple problem.

Does your program needs random number between 0-9 or it can be any random no not being repeated.

Also you dont need 3 loops but 2 will do using the break and continue statement. Here is the sample of what you are looking for probably
Code: c
int i=0,j=0,r;
int arr[10];
int flag = 0;
for(i=0;i<10;)
{
    r = rand();
    if(r < 10)
    {
        flag = 0;
        for(j=0;j<i;j++)
        {
            if(arr[j] == r)
            {
                flag = 1;
                break;
            }
        }
        if(flag == 1)
            continue;
        arr[i] = r;
        printf("%d ",r);
        i++;
    }
}
printf("\n");