If n = 0, return true.
If n < 0, set n = -n.
Iterate n <-- (n >> 2) + (n & 3) until n <= 3.
If n = 3, return true; else return false.

Dave

On Jun 5, 1:45 pm, divya <[email protected]> wrote:
> Find if a number is divisible my 3, without using %,/ or *. You can
> use atoi().

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to