I have to write a C program that converts decimal to binary using numbers between 0 to 255. using 3 functions and no global variables. When I get it to run it just prints all zeros for some reason. This is what I have so far:

```
#include <stdio.h>

int getNumber();
int dectoBin(int, int binarray[], int);
void printBin(int binary[], int dec);

int main(){
    int M = 7;
    int binarray[M];
    int dec = getNumber();
    printf("The decimal number you entered was: %d", dec);
    *binarray = decToBin(dec, binarray, M);
    printBin(binarray, dec);
    return 0;
}

int getNumber(){
    int dec;
    printf("Enter any a number between 0 and 255: ");
    scanf("%d",&dec);
    return 0;
}

int decToBin(int dec, int binarray[], int M){
    int i, j;
    if(dec>255)
        printf("Please enter a number between 0 and 255");
    else
        for(i=7; i>=0;i--){
            j = dec >>i;
            if(j & 1){
                binarray[i] = 1; 
            }
            else {
                binarray[i] = 0; 
            } 
        }
    return *binarray;
}

void printBin(int binary[], int dec){
    int i;
    if(dec > 255){
        printf("PLese use another number");
        main(); 
    }
    else
    {
        for(i =7; i > 0;i--){
            printf("%d", binary[i]);
            printf("\n");
        }
    }

}

```