added encode and decode program in C and Java