K&R programming solutions