Check if a number is multiple of 5 without using / and % operators | Assuming that integer takes 4 bytes , there can be maximum 10 digits in a integer ; Check the last character of string ; Driver Code
MAX = 11 ; function isMultipleof5 ( n ) { str = Array ( n ) . fill ( ' ' ) ; var len = str . length ; if ( str [ len - 1 ] == ' ' str [ len - 1 ] == ' ' ) return true ; return false ; } var n = 19 ; if ( isMultipleof5 ( n ) == true ) document . write ( n + " " + " " ) ; else document . write ( n + " " + " " ) ;