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

How can you convert integers to binary or hexadecimal?

0 Answers  


second highest number in a given set of numbers

3 Answers   TCS,


How to receive strings with spaces in scanf()

7 Answers  


Calculate 1*2*3*____*n using recursive function??

0 Answers  


What are the types of c language?

0 Answers  






What is output redirection?

0 Answers  


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

0 Answers  


What is the difference between GETS();AND SCANF();

4 Answers   TCS,


What are inbuilt functions in c?

0 Answers  


How can a program be made to print the name of a source file where an error occurs?

0 Answers  


write a program in c to read array check element is present or not?

1 Answers  


Why is it important to memset a variable, immediately after allocating memory to it ?

0 Answers  


Categories