OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.misc-tests/] [acker1.c] - Blame information for rev 832

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
#include <stdio.h>
2
 
3
int acker(int, int);
4
 
5
int
6
main(void)
7
{
8
    int n = acker(3,6);
9
    if (n != 509)
10
        printf("acker(3,6) = %d != 509\n", n);
11
    return(0);
12
}
13
 
14
int
15
acker(int x,int y)
16
{
17
    if (x==0)
18
        return(y+1);
19
    else if (y==0)
20
        return(acker(x-1,1));
21
    else
22
        return(acker(x-1, acker(x, y-1)));
23
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.