
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#define ORIGINAL_STRING_SIZE 10
 
 int i;
 char bin[][5]={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
 char hex[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
        
        

int main()
{
	char *cipher="9191ABA49C";	
	char *dbit;
	char *decrypted;
	char c;
	int move;
	
	
	decrypted=(char*)malloc(ORIGINAL_STRING_SIZE*4 +1);
	
	for(i=0;i<ORIGINAL_STRING_SIZE;i++){
		dbit=(char*)malloc(5);
		c=cipher[i];
		//printf("\n%c",c);
// converting HEX to DECIMAL
	
		if((int)c >= 'A' && (int)c <= 'F')
		{
			move=10+ (int)(c - 'A');
			//printf("%d",move);
		}
		else{
			move=(int)(c-'0');
		}
		strcpy(dbit,bin[move]);
		
		strcat(decrypted,dbit);
	}
	puts(decrypted);	
	printf("\n\n%d",strlen(decrypted));
	return 0;
	
}

