Source: http://vlm1.uta.edu/~athitsos/courses/cse1310_spring2016/lectures/05a_printf.pdf