Please correct me in Flow007

Solution: 55255657 | CodeChef @ssjgz

I don’t know what is wrong but I’m getting the correct output. Please help me out with these

#include <stdio.h>
int main()
{
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++)
{
int n, q, p[100000] = {0}, len = 0, dig;
scanf("%d", &n);
q = n;
while (q)
{

            q = q / 10;
            ++len;
        }
    for (int j = 0; j < len; j++)
    {
        dig = n % 10;
        p[j] = dig;
        n = n / 10;
    }
    for (int k = 0; k <= (len - 1); k++)
    {
        printf("%d", p[k]);
    }
    printf("\n");
}

return 0;

}

Your output for the sample input does not match the expected output.