Represent the given number as the sum of two composite numbers | C ++ implementation of the approach ; Function to find two composite numbers which when added give sum as n ; Only 8 and 10 can be represented as the sum of two composite integers ; If n is even ; If n is odd ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findNums ( int n ) { if ( n <= 11 ) { if ( n == 8 ) cout << "4 ▁ 4" ; if ( n == 10 ) cout << "4 ▁ 6" ; else cout << " - 1" ; return ; } if ( n % 2 == 0 ) cout << "4 ▁ " << ( n - 4 ) ; else cout << "9 ▁ " << ( n - 9 ) ; } int main ( ) { int n = 13 ; findNums ( n ) ; return 0 ; }