Modulo ( % ) is probably the way to go.
Modulo is a mathematical operation that restricts an integer to the range of 0 to mod-1, in other words, the result is the remainder of a division. It’s an important and very interesting “tool”, e.g. cryptography often relies on it (in a more complex way of course) in its important steps.
Some simple examples:
- 55 % 100 = 55
- 124 % 100 = 24
- 36 % 5 = 1
- 30 % 5 = 0
- 0 % any integer (except 0 of course) is always 0
- any integer % 1 is always 0
Note, that it works a bit differently with negative numbers, at least in mathematics. Programming languages like C#, Java, … often treat negative numbers just like positive numbers when using modulo.
In many programming languages, (-7)%10 will be 7, in number theory (modular arithmetic), the result is 3. I’m not sure why programming languages use this “wrong” implmentation, who knows, maybe there’s a reason for it.
Back to your question, it could be something along these lines
(you left out every (k100)th number, so I treat them seperately*)
int tmp = score % 200;
if(tmp == 0 || tmp == 100) //could also be written as " if(tmp % 100 == 0) "
{
// do stuff when score is 0, 100, 200, 300, 400, 500, 600
}
else if(tmp < 100)
{
// score is 1 - 99, 201 - 299, 401 - 499, ....
// condition 1
}
else
{
// score is 101 - 199, 301 - 399, 501 - 599, ...
// condition 2
}