im tring to code a program that will convert decimals in to binaries... but i need it to keep dividing the numbers untill 1 or 0 or untill it cant divide anymore.. but i cant get it to work any help?

Code:
int binary( int decimal )
{
    int x, y;
    char  remainder[10];
    char  converted[10];

    for( x = 0; x < decimal; x++ )
    {
          x = ( decimal / BASE_2 );

          *remainder = decimal % x;
          strcpy( converted, remainder );
          printf( "%d\n", converted[x] );

    }

   // return x;
}