如何防止写入0而不是未输入的数组元素?

I have an assignment, and what we asked for is exactly: The user will enter a number between 0 and 999.999. The steps of this number will be assigned to an array and the array will be printed on the screen. Then repeating numbers in this array will be found and printed on the screen. Here is my source code. My problem is that when the user enters a non-6-digit number, for example, when a 4-digit number is entered, the last 2 elements of the array are automatically 0. As you see below, output says "0 is repeated 2 times". How can I prevent these 0s from being created? enter image description here

#include "stdlib.h"
#include <stdio.h>
#include "Windows.h"

int array[6];

void startup()
{
    printf("\t\t\t\t-----------------------------------------\n");
    printf("\t\t\t\t|                   |\n");
    printf("\t\t\t\t|    Program is starting...         |\n");
    printf("\t\t\t\t|                   |\n");
    printf("\t\t\t\t-----------------------------------------\n");

    printf("Program is starting. ");
    printf("3..");
    Sleep(1000);
    printf("2..");
    Sleep(1000);
    printf("1");
    Sleep(1000);
    system("cls");
}

void getnumber()
{
    int number, j = 0;

    printf("Enter a number between 0 and 999999: ");
    scanf_s("%d", &number);

    if (number >= 0 && number <= 999999)
    {
        for (int i = 10; j <= 5; j++)
        {
            array[j] = (number % i);
            number = number / i;
            if (number == 0)
            {
                break;
            }
        }

        printf("\n");

        for (j; j >= 0; j--)
        {
            printf("%d ", array[j]);
        }

        printf("\n\n");
    }
    else
    {
        printf("Enter a number in the specified range.\n\n");

        printf("\t\t\t\t-----------------------------------------\n");
        printf("\t\t\t\t|                   |\n");
        printf("\t\t\t\t|         Going back....            |\n");
        printf("\t\t\t\t|                   |\n");
        printf("\t\t\t\t-----------------------------------------\n");

        printf("Going back. ");
        printf("3..");
        Sleep(1000);
        printf("2..");
        Sleep(1000);
        printf("1");
        Sleep(1000);
        system("cls");

        getnumber();
    }
}

void repeateddigit()
{
    for (int i = 0; i <= 5; i++)
    {
        int repeated = 1;

        for (int j = (i + 1); j <= 5; j++)
        {
            if (array[i] == array[j])
            {
                repeated++;
            }
        }
        printf("%d is repeated %d times.\n", array[i], repeated);
        while (array[i] == array[i + 1])
        {
            i = i + 1;
        }
    }
}

int main()
{
    startup();
    getnumber();
    repeateddigit();

    printf("\n");

    system("PAUSE");
    return 0;
}