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 are the 5 data types?

0 Answers  


Explain threaded binary trees?

0 Answers  


write a program that explain #define and # undef directive

1 Answers  


who invented c

13 Answers   IBM,


What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); }

8 Answers   ADITI, Adobe,






A program to write a number of letters and numbers, such as counting and display

0 Answers  


Which type of language is c?

0 Answers  


What is the o/p of the follow pgm? #include<stdio.h> main() { char char_arr[5]=”ORACL”; char c=’E’; prinf(“%s\n”,strcat(char_arr,c)); } a:oracle b. oracl c.e d.none

2 Answers   Oracle,


What is character constants?

0 Answers  


What is signed and unsigned?

0 Answers  


What would be an example of a structure analogous to structure c?

0 Answers  


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


Categories