Input validation multiples of 100??

Hi guys, I am suppose to write a code to make sure the users input is between 0 and 4000 and also a multiple of 100. How do i do the mulitple of 100 part? So far i have this..

[code]
cin >> store1;
while ( store1 < 0 || store2 > 4000)
{
cout << "Invalid entry";
}
[\code]
One word: modulo (%). Also, what is store2?
oh sorry it was a typo i meant store1 and also yeah but i dont know how to combine the modulus into my code

i tired this and it didnt work

 
while ( store1 % 100 != 0 && store1 < 0 || store1 > 4000 )
The != should be ==
no it can't be == because my code is saying if the input for store1 is not between 0-4000 or is not a multiple of 100 then an error message will be displayed.
(a && b || c) is the same as ((a && b) || c), not (a && (b || c)).
Topic archived. No new replies allowed.