To get odd number of N digit subtract 2 from B ^ n
odd = Math . Pow ( b , n ) - 2 ; } Console . WriteLine ( " Even ▁ Number ▁ = ▁ " + ( int ) even ) ; Console . Write ( " Odd ▁ Number ▁ = ▁ " + ( int ) odd ) ; }