Number formed by deleting digits such that sum of the digits becomes even and the number odd | Function to convert a number into odd number such that digit - sum is odd ; Loop to find any first two odd number such that their sum is even and number is odd ; Print the result ; Driver Code
function converthenumber ( n ) { var s = n . toString ( ) ; var res = " " ; var i ; for ( i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] == ' ' s [ i ] == ' ' s [ i ] == ' ' s [ i ] == ' ' s [ i ] == ' ' ) res += s [ i ] ; if ( res . length == 2 ) break ; } if ( res . length == 2 ) document . write ( res ) ; else document . write ( " " ) ; } var n = 18720 ; converthenumber ( n ) ;