Largest Even and Odd N | C ++ implementation of the approach ; Function to print the largest n - digit even and odd numbers in hexadecimal number system ; Append ' F ' ( N - 1 ) times ; Append ' E ' for an even number ; Append ' F ' for an odd number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findNumbers ( int n ) { string ans = string ( n - 1 , ' F ' ) ; string even = ans + ' E ' ; string odd = ans + ' F ' ; cout << " Even : ▁ " << even << endl ; cout << " Odd : ▁ " << odd << endl ; } int main ( ) { int n = 2 ; findNumbers ( n ) ; return 0 ; }