I am trying to work out an equation for calculating how many times the code below (y and z are constants) will run before it starts to repeat itself.
while (true) {
std::cout << (x * y) % z << std::endl;
x++
}
For example, with a being 100 and z being 360, the code will run 18 times before the output becomes 0 again.
int y = 100;
for (int i = 0; i < 19; ++i) {
std::cout << y*i % 360 << std::endl;
}