Need Some Help Finding the Problem!!!!!!!

I can't figure out why the function is not returning the integer 1 or 0 ... Can someone please help I've tried everything that I felt I know about programming and can't figure it out. I need a solution to my program not how to write it with a different program unless mine is completely wrong ... Thanks and help is very appreciated ... Here's the question and my program:

/*We have two arrays A and B, each of 10 integers. Write a function that
tests if every element of array A is equal to its corresponding element in
array B. The function is to return true (1) if all elements are equal and
false (0) if at least one element is not equal.*/

#include <stdio.h>
#include <iostream>
#include <time.h>

using namespace std;

int TEST (int arrayA[], int arrayB[], int j);

int main()

{
srand (time(NULL));

int k, j = 0;
int arrayA[10], arrayB[10];

for (k = 0; k <= 9; k++)
{
arrayA[k] = rand()%20;
arrayB[k] = rand()%20;
}

printf(" # Array A Array B\n");
printf("-------------------------------\n");

for (k = 1; k <= 9; k++)
{
if (arrayA[k-1] >= 10)
{
printf(" %i %i %i\n", k, arrayA[k-1], arrayB[k-1]);
}
else
{
printf(" %i %i %i\n", k, arrayA[k-1], arrayB[k-1]);
}
}
if (arrayA[9] >= 10)
{
printf(" 10 %i %i\n\n", arrayA[9], arrayB[9]);
}
if (arrayA[9] < 10)
{
printf(" 10 %i %i\n\n", arrayA[9], arrayB[9]);
}

printf(" # EQUAL/NOT EQUAL\n");
printf("--------------------------\n");

for (j = 0; j <= 8; j++)
{
TEST (arrayA, arrayB, j);

if (TEST == 0)
{
printf(" %i NOT EQUAL\n", j+1);
}

else
{
printf(" %i EQUAL\n", j+1);
}
}

TEST (arrayA, arrayB, 9);

if (TEST == 0)
{
printf(" 10 NOT EQUAL\n\n");
}

else
{
printf(" 10 EQUAL\n\n");
}
}




int TEST (int arrayA[], int arrayB[], int j)

{
if (arrayA[j] == arrayB[j])
{
return 1;
}

else
{
return 0;
}
}
if (TEST == 0) did you mean if (TEST (arrayA, arrayB, 9) == 0)?
Thanks @Danny Toledo ... can't believe I missed that!!! Appreciate the help.
Topic archived. No new replies allowed.