SyntaxFix
Write A Post
Hire A Developer
Questions
Try
public bool IsDivisible(int x, int n) { return (x % n) == 0; }
The modulus operator % returns the remainder after dividing x by n which will always be 0 if x is divisible by n.
For more information, see the % operator on MSDN.