jeudi 17 avril 2014

Windows - c# que permettent les multiples de 10 s de l'utilisateur - Stack Overflow


I was wondering how to only allow users to input values that are multiples of 10 i.e. 10, 20, 30 and so on. Example of a number that's not allowed 105.


Thanks in advance.




Use the % Operator


if(userInput % 10 == 0)
{
//valid
}


I was wondering how to only allow users to input values that are multiples of 10 i.e. 10, 20, 30 and so on. Example of a number that's not allowed 105.


Thanks in advance.



Use the % Operator


if(userInput % 10 == 0)
{
//valid
}

0 commentaires:

Enregistrer un commentaire