Implement makeCounter() returning a function that returns 1, 2, 3... on successive calls. The input is a single integer n — create ONE counter and call it n times, printing each result on its own line.
Input: one integer n.
Output: n lines: 1..n.
Your program reads from stdin and prints to stdout.
Implement makeCounter() returning a function that returns 1, 2, 3... on successive calls. The input is a single integer n — create ONE counter and call it n times, printing each result on its own line.
Input: one integer n.
Output: n lines: 1..n.
Your program reads from stdin and prints to stdout.