The rule of divisibility to 4 is the following , if the number which is formed by the 2 last digits of the given number is divisible to 4 then the number itself is divisible to 4. The input is huge so we need to input it as a string, take the last 2 digit and check for divisibility of that 2 digit number, if it is divisible then the given number is divisible as well.
No comments:
Post a Comment