aboutsummaryrefslogtreecommitdiff
path: root/doc/ack.c
blob: 46fd3041a48bba60ec1f62564b105c94a7fd1814 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Ackermann's function */

typedef unsigned long u_long;

u_long
ack (u_long a, u_long b) 
{
  if (a == 0)
    return b + 1;
  if (b == 0)
    return ack (a - 1, 1);
  return ack (a - 1, ack (a, b - 1));
}

Return to:

Send suggestions and report system problems to the System administrator.