// An example of a C program with a recursive function #include int sum_to(int n); int main(void) { int max = 10; int result = sum_to(max); printf("Sum 1.. "); printf("%d", max); printf(" = "); printf("%d", result); putchar('\n'); return 0; } int sum_to(int n) { int result; sum_to_if_0: if (n != 0) goto sum_to_else; return 0; sum_to_else: result = sum_to(n-1); return n + result; }