#include <stdio.h>
int main()
{
int ix;
unsigned hits = 0;
for (ix=0; ix < 128; ix++)
{
if (ix % 4 == 0)
continue;
hits++;
}
printf("%u hits\n", hits);
return;
}
This isn't a programming question, I have no code like this. But I'm interested in the mathematical way to handle such a problem. The printf returns "96 hits" My question is, is there a formula for calculating 'hits' without the loop?