Check if Decimal representation of an Octal number is divisible by 7 | Function to check Divisibility ; Sum of all individual digits ; Condition ; Octal number
function check ( n ) { let sum = 0 ; while ( n != 0 ) { sum += n % 10 ; n = Math . floor ( n / 10 ) ; } if ( sum % 7 == 0 ) return 1 ; else return 0 ; } let n = 25 ; ( check ( n ) == 1 ) ? document . write ( " " ) : document . write ( " " ) ;