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 is actual parameter different from the formal parameter?
What does int main () mean?
What is the c value paradox and how is it explained?
What is "Hungarian Notation"?
What is the difference between array and pointer?
When should we use pointers in a c program?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What is the use of function in c?
Explain what are reserved words?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Why do we use namespace feature?
Write a C program to count the number of email on text
What is function what are the types of function?
What is the difference between the expression “++a” and “a++”?
can we have joblib in a proc ?