Cで言うこう言うのはどう実現すれば良いでしょうか。
staticキーワードはメソッド内の変数には使えないみたいなので。

void hoge(){
static int a;

a = (a + 1) % 5;

if(a == 0){
printf("OK\n");
}
}