Here, I need to come out of the function when counter reaches specific number(10 as per example).Now, the condition is, I can't take this counter as global or static or can't pass this counter as parameter.