LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Divisibility without using modulus (https://www.linuxquestions.org/questions/programming-9/divisibility-without-using-modulus-296527/)

redhatrosh 03-01-2005 09:44 PM

Divisibility without using modulus
 
The aim of the program is to find whether a number is divisible without using the modulus operator
What do I mean by this?
If I say 27 is divisible by 3, a routine has to be followed which does not include modulus operator to check whether 27 is divisible by 3 and follows some other procedure for checking divisibility!

Can anyone provide me a solution?

jtshaw 03-01-2005 10:02 PM

This smells of homework....

There is something common between all numbers that aren't evenly divisible... just think about what that is... I'll give you a hint, you can implement this in one line using mod's sister function....


All times are GMT -5. The time now is 04:25 PM.