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
how can f be used for both float and double arguments in printf? Are not they different types?
Explain how can a program be made to print the name of a source file where an error occurs?
How is a structure member accessed?
What are file streams?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
What are header files and explain what are its uses in c programming?
What is the purpose of void in c?
Why c is called a middle level language?
What are identifiers in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is 02d in c?
What functions are in conio h?
What is the difference between union and anonymous union?
Write a program to generate random numbers in c?
Are c and c++ the same?