lol will become 0 when your code exits from while loop, so it will never greater than q. Then your for loop will not reach the end.