Jason C. answered 02/15/23
College-level Computer Science student
Ok, so in C++ there is an operator called modulo (%). This gives you the remainder when dividing two numbers.
When a number is divisible by another, the remainder is 0.
As for the main, I will leave that to you.
A parting gift: use cin to get the input.
https://cplusplus.com/doc/tutorial/basic_io/