Tuesday, August 19, 2014

COJ 1306. Div 4

 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.


       FULL SOURCE CODE

No comments:

Post a Comment