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

Answers were Sorted based on User's Feedback



int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / sindhu

shobha is correct.

Is This Answer Correct ?    6 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / shobha

ans is 9

Is This Answer Correct ?    4 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / hussain reddy

9

Is This Answer Correct ?    2 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / mannucse

a

Is This Answer Correct ?    2 Yes 1 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / tej

ans is 9

Is This Answer Correct ?    1 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / mazhar

fn name and variable name are same it get overloaded..

by changing the variable name the ans will be: 9

Is This Answer Correct ?    1 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / ravinderreddy

ans: b

Is This Answer Correct ?    0 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / sundar

8

Is This Answer Correct ?    0 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / vint

Ans: 9

Is This Answer Correct ?    0 Yes 0 No

int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the..

Answer / arunthathi

sindhu is correct

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What is the relationship between pointers and data structure?

0 Answers  


#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }

15 Answers   Infosys,


Is it cc or c in a letter?

0 Answers  


Why cd or dvd are round why not square.

1 Answers  


f=(x>y)?x:y a) f points to max of x and y b) f points to min of x and y c)error

4 Answers   HCL,






Explain pointer. What are function pointers in C?

0 Answers   HCL,


write a program to print data of 5 five students with structures?

0 Answers  


Explain what’s a signal? Explain what do I use signals for?

0 Answers  


Explain what is a program flowchart and explain how does it help in writing a program?

0 Answers  


What are comments and how do you insert it in a C program?

0 Answers  


What is the Lvalue and Rvalue?

2 Answers  


Explain what is #line used for?

0 Answers  


Categories