What is wrong with my code?

@wtakashish
What if rows = 1? your code would still print 2 lines.