Question: So I have 3 int type arrays, A, B and C. The program checks array A elements for prime numbers, if the number is prime in array it gets copied to array B, if not array C. Later it prints all three arrays. 

This is the code piece a have problems with: 

```
    if(onalg)
    {
    B[i]=A[i];  
    }
    else
    {
    C[i]=A[i]; 
    }

```

Then sort the array B and C using qsort ( done this, works ).
After all that it has to print all arrays like this:

```
for(i=0;i<n;i++)
{
    printf("%d        %d        %d\n", A[i],B[i], C[i]);
}

```

How can I make it print empty spots in array? Currently it prints some random numbers in array C[i] spot when B[i]=A[i] and in array B[i] when C[i]=A[i].

Answer: 
Either initialize your arrays `B` and `C` before you start filling them in (with `memset` for instance), or set them both in each conditional.

```
if(onalg)
{
    B[i]=A[i];  
    C[i]=-1;  // or some other constant
}
else
{
    C[i]=A[i]; 
    B[i]=-1;  // or some other constant
}

```

If you don't have a constant you can use as a "guard", consider using two more arrays, properly initialized, that store whether that index in `B` and `C` resp. is set or not.

You'll need more logic in your display code either way to print out a blank for "unset" values.
When you want it to be empty, you can set the B[i] or C[i] to 0, and then print it one by one by checking if the value is 0.