Largest Even and Odd N | C ++ implementation of the approach ; Function to print the largest n - digit even and odd numbers ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findNumbers ( int n ) { int odd = pow ( 10 , n ) - 1 ; int even = odd - 1 ; cout << " Even ▁ = ▁ " << even << endl ; cout << " Odd ▁ = ▁ " << odd ; } int main ( ) { int n = 4 ; findNumbers ( n ) ; return 0 ; }