added public domain code for printf and scanf.