Source

Caml / MiniProj / ex03.bl

fact(x)
{
  vars res;
  if (x < 0)
  {
    return 0;
  }
  res = 1;
  while (x > 0)
  {
    res = res * x;
    x = x - 1;
  }
  return res;
}

main()
{
  vars a;
  a = 5;
  write(fact(a));
}