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
Explain the difference between exit() and _exit() function?
What is sizeof return in c?
what is stack , heap ,code segment,and data segment
What does a pointer variable always consist of?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
How can I convert a number to a string?
What is struct node in c?
Why c is a mother language?
Why we use stdio h in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is difference between union All statement and Union?
What are the different types of control structures in programming?
Why we not create function inside function.
Explain data types & how many data types supported by c?
What is the meaning of c in c language?