various coding algorithms solved in c