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
What is a void * in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What does void main () mean?
Is c is a procedural language?
How pointers are declared?
What is a dynamic array in c?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What is meant by high-order and low-order bytes?
Suggesting that there can be 62 seconds in a minute?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Explain how can I manipulate strings of multibyte characters?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?