Smallest Even number with N digits | Java implementation of the approach ; Function to return smallest even number with n digits ; Driver code
class Solution { static int smallestEven ( int n ) { if ( n == 1 ) return 0 ; return Math . pow ( 10 , n - 1 ) ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( smallestEven ( n ) ) ; } }