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 how can I pad a string to a known length?
How can I recover the file name given an open stream?
Is r written in c?
Explain what is the difference between text files and binary files?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What is structure pointer in c?
What are the application of c?
Differentiate between functions getch() and getche().
What is null pointer in c?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Why c is called a mid level programming language?
What is pointer & why it is used?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Describe explain how arrays can be passed to a user defined function