c# - Check if variable values are close to each other -


Assume that we find two variables:

  int test = 50; Int test1 = 45;  

Now I have to check that if within test1 the value is within 5 / +5 in the test . How can I do this?

Looks like you just want to check that the difference between two numbers is within a certain limit .

  // Get the difference difference test = test1; // If the range (-5>  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -