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 header files do I need in order to define the standard library functions I use?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What is c value paradox explain?
What is the difference between array and linked list in c?
What is the use of extern in c?
what are # pragma staments?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What is array of structure in c programming?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
Did c have any year 2000 problems?
what do the 'c' and 'v' in argc and argv stand for?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is the condition that is applied with ?: Operator?
What is huge pointer in c?
Define the scope of static variables.