Source: http://ranger.uta.edu/~alex/courses/1310/lectures/05a_input_printf_a.pdf