Smallest Even number with N digits | C ++ implementation of the approach ; Function to return smallest even number with n digits ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int smallestEven ( int n ) { if ( n == 1 ) return 0 ; return pow ( 10 , n - 1 ) ; } int main ( ) { int n = 4 ; cout << smallestEven ( n ) ; return 0 ; }