Added logic to the Printf statement