void printi(int val);

int function(int val)
{
  return val;
}

int function2(int val)
{
  return val + 10;
}

int function3(int val)
{
  return val + 20;
}

int main()
{
  int val, i;
  int (*f[4])(int val);

  f[0] = function;
  f[1] = function2;
  f[2] = function3;
  f[3] = 0;

  for (i = 0; f[i]; i++) {
    val = f[i](i);
    printi(val);
  }

  return 0;
}
