Link to home
Start Free TrialLog in
Avatar of Ajs135
Ajs135

asked on

c# Condtion to only accept Multiples of 20's....

i want to put a condition that  the user can only withdrawal multiples of 20's.  how would i do this?

i tried something like    if(  input    !=  input %20)  but that only letting accept 2 . . so it only letting type the remainder 20.     if i put it == , it just ignores all completely, b/c i put 35 and it goes thru still.
ASKER CERTIFIED SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
pratima@ is right actually input %20 this means divide input on 20 and if it will divide completely means no remainder then you have multiple of 20 so

if(input %20 == 0) will work fine

Thanks,