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].