Look at your code:
public bool Verify(int value)
{
bool isFive = false;
while (value != 0)
{
int _digit = value % 10;
if (_digit == 5)
{
isFive = true;
}
}
return isFive;
}
Where inside your loop do you change
value
?
If
value
doesn't change, then whenever you call
Verify
with a non-zero
value
it can never exit the loop, and thus never return.
Perhaps you want to divide
value
by ten inside the loop?
To be honest, 2 minutes running this with the debugger and you would have found it for yourself, and saved half an hour of your time ... if you get a problem in future, reach for the debugger first and see exactly what is happening while you code is running!