The problem is:
Write an algorithm that reads 3 vectors
A[1..10], B[1.10] e C[1..10]
and writes the elements that are in A and B (intersection) but are not Write the values in the order they appear in vector A. three vectors should be read separately (first, the whole vector A, then vector B and finally vector C).
My solution (which is not running):
#include <stdio.h>
int main()
{
int A[10], B[10], C[10], i, j, k;
for (i=0; i<=9; i++)
scanf ("%d",&A[i]);
for (j=0; j<=9; j++)
scanf ("%d",&B[j]);
for (k=0; k<=9; k++)
scanf ("%d",&C[k]);
for (i=0; i<=9; i++)
{
for (j=0; j<=9; j++)
{
if (A[i]==B[j])
{
for (k=0; k<=9; k++)
{
if (A[i]!=C[k])
printf ("%d\n",C[k]);
}
}
}
}
}
Where is the error and how can I fix it?