answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<stdlib.h>

int ack(int,int);

main()

{

int m,n;

printf("Enter the value for m : ");

scanf("%d",&m);

printf("Enter the value for n : ");

scanf("%d",&n);

if(m<n)

printf("The value is : %d\n",ack(m,n));

else

printf("Evaluation is not possible");

}

int ack(int m,int n)

{

int r;

if(m==0)

r=n+1;

else if(m!=0 && n==0)

r=ack(m-1,1);

else

r=ack(m-1,ack(m,n-1));

return r;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
User Avatar

Abhishek Kumar Singh

Lvl 1
2y ago
Output

Add your answer:

Earn +20 pts
Q: Write a c program to implement Ackermann function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to implement prim's algorithm?

dfgbrgffee


Write A program to implement insertion using AVL trees?

yes


Write a program to implement domain and referential integrity?

give me the program which can related on domain and referential integrity.


Where do we write main function in a c program?

Into the source program.


Write a routine to implement the t e x t function?

There are many ways you could write a routine to implement text functions. You could, for example, come up with codes.


Write a program in c plus plus to implement macro processor?

Don't write, it is already written, google for 'cpp'.


Write a program in c language to implement framing methods like character stuffing?

A program in c language to implement framing methods like character stuffing can be grave sizeCRC-32 and the variable c50.


Write a program to implement a line using slope intercept formula?

lund lelo mooh mein


Write a program of binary heap in c or c language?

to implement operations on binary heap in c


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


Can you write a program without specifying the prototype of any function?

You can write a program without specifying its prototype when the function returns an integer.If the prototype is not mentioned the compiler thinks that the return type of the function used is integer.When making program which return integer you can ignore writing the protoype.


Write a c program for matrix addition using function?

#include&lt;