I use the same concept in odd even using recursion but it goes in infinite loop