Find the Output: Shared counter across while and for