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 / gg
Error::invalid lvalue in assignment
for both the statements followed by IF & ELSE .
coz zap is a function name.And trying to assign a value.
if the Code is :
int zap(int n)
{
int zap1;
if(n<=1)
(zap1 = 1);
else
(zap1 = zap(n-3)+zap(n-1));
}
Ans Is :: 1
If the Code is :
int zap(int n)
{
int zap1;
if(n<=1)
return (zap1 = 1);
else
return (zap1 = zap(n-3)+zap(n-1));
}
Ans Is ::9
| Is This Answer Correct ? | 23 Yes | 4 No |
Post New Answer View All Answers
What is call by value in c?
Explain how do you print an address?
What are the preprocessor categories?
hi any body pls give me company name interview conduct "c" language only
What are header files and explain what are its uses in c programming?
How many types of operator or there in c?
What is binary tree in c?
What is an lvalue in c?
write a program to print largest number of each row of a 2D array
Write a program to identify if a given binary tree is balanced or not.
Can you mix old-style and new-style function syntax?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is f'n in math?
Explain Function Pointer?
What is the use of getch ()?