Why the program prints line twice?

Printable View