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
Do string constants represent numerical values?
What is multidimensional arrays
Why n++ execute faster than n+1 ?
Is c high or low level?
Why flag is used in c?
Are local variables initialized to zero by default in c?
What are the different types of linkage exist in c?
Who is the main contributor in designing the c language after dennis ritchie?
Why doesn't C support function overloading?
Compare interpreters and compilers.
What are reserved words with a programming language?
Explain what is the difference between #include and #include 'file' ?
How many bytes are occupied by near, far and huge pointers (dos)?
Why does the call char scanf work?
When should you use a type cast?