#include <stdio.h> #include <conio.h> int ack(int m, int n) { if(m==0) return (n+1) ; else if(n==0 && m>0) return ( ack(m-1,1) ) ; else return ( ack(m-1, ack(m,n-1) ) ); } void main() { int m, n ; clrscr() ; printf("Enter two numbers: ") ; scanf("%d %d", &m, &n) ; printf("Solution is %d", ack(m,n) ) ; getch() ; }
Enter two numbers: 2 3 Solution is 9