C program code
int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
Answer Posted / manishsoni
int zap(int n)
{
int a;
if(n<=1)
a=1;
else
a=zap(n-3)+zap(n-1);
return a;
}
main()
{
int result;
result=zap(6);
printf("%d",result);
getch();
}
it gives us 9;
Manish soni(MoNu)
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Why c is procedure oriented?
Explain what is the advantage of a random access file?
Why calloc is better than malloc?
Explain what is the difference between text files and binary files?
Is swift based on c?
What is a pointer in c plus plus?
What's the best way of making my program efficient?
Why is c platform dependent?
What is the difference between far and near in c?
What is local and global variable in c?
What is a constant?
What is bash c?
What is assert and when would I use it?
How can I read data from data files with particular formats?
Explain the difference between getch() and getche() in c?