#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIGN1 printf(" * ");
#define SIGN2 printf(" = ");

int dec2bin( int n );

int main( void )
{
	int c1, c2, r;

	for( c1 = 1 ; c1 < 10 ; c1++ )
	{
		printf("=====================\n");
		for( c2 = 1 ; c2 < 10 ; c2++ )
		{
			r = c1 * c2;
			dec2bin(c1); SIGN1 dec2bin(c2); SIGN2 dec2bin(r);
			printf("\n");
		}
	}
	printf("=====================\n");
}
int dec2bin( int n )
{
	if( n == 0 )
	{
		return 0;
	}
	else
	{
		dec2bin(n/2);
		printf( "%d" , (n%2) ? 1 : 0 );
	}
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       