You're viewing a comment by vishal chovatiya and its responses.

vishal chovatiya Permalink
January 12, 2015, 06:27

The most simple way to check for n’s divisibility by 9 is to do n%9.
Another method is to sum the digits of n. If sum of digits is multiple of 9, then n is multiple of 9.
The above methods are not bitwise operators based methods and require use of ‘%’ and ‘/’. The bitwise operators are generally faster than modulo and division operators. Following is a bitwise operator based method to check divisibility by 9..

you can check this also with the example :-

http://www.firmcodes.com/check-number-multiple-9-using-bitwise-operators/

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "server_143": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.