@Mohit: The decimal representation of a number ends in 5 if its low order bit is 1 and it is divisibile by 5. An algorithm using bitwise operations to check for divisibility by 5 is given at https://groups.google.com/d/msg/algogeeks/I5HWmwKW_ks/n38FWJSd0l8J.
It probably is not as fast as (n & 1) && (n % 5 == 0), though. Dave On Wednesday, October 10, 2012 4:06:28 AM UTC-5, mohit mishra wrote: > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/bRupe9F1MUIJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.