Append ' F ' for an odd number
String odd = ans + ' F ' ; System . out . print ( " Even : ▁ " + even + "NEW_LINE"); System . out . print ( " Odd : ▁ " + odd + "NEW_LINE"); } private static String string ( int n , char c ) { String str = " " ; for ( int i = 0 ; i < n ; i ++ ) str += c ; return str ; }