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 / madhu

if (n<=1)
zap = 1;
it gives a compile time error invlaid l value assignment.
zap is a function and cannot be assigned a value

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pointers in C? Give an example where to illustrate their significance.

748


How can I read/write structures from/to data files?

547


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

1762


Why string is used in c?

580


How can I run c program?

683






How to set file pointer to beginning c?

666


What are structural members?

568


What is the use of getch ()?

631


What does int main () mean?

549


Is main is user defined function?

597


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1633


What functions are used in dynamic memory allocation in c?

595


Define recursion in c.

699


What are two dimensional arrays alternatively called as?

660


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

683