So every time the loop executes, you'd like 'k' to increase by 1? The problem here is that you have still left in cin >> k;. This is used to get the user's input, so that's why you have to enter the values!
Remove that line, and you should be good to go. (If you feel like cleaning up your code, change 'k = k+1' to 'k++' and maybe switch the while loop into a for loop.