As your code is written, the loop will not be entered. NUM_DAYS % NUM_PERSON
will evaluate to true
, so num
will equal NUM_DAYS / NUM_PERSON
. Since we are dealing with ints, 65 / 33
is equal to 1
. 1 -1
is 0
, so the while condition will fail.
If your code is written as intended (as in, those constants are the values you are expecting to always use), just remove the while loop. It will never be used. If, however, NUM_DAYS
or NUM_PERSON
may later contain other values, you probably have nothing to worry about. If those specific values aren't important, try setting them to values such that the division will evaluate to something greater than 1
.