Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What header files do I need in order to define the standard library functions I use?

1059


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1859


What is c value paradox explain?

1093


What is the difference between array and linked list in c?

1158


What is the use of extern in c?

1094


what are # pragma staments?

2046


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

1155


What is array of structure in c programming?

1291


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

1252


Did c have any year 2000 problems?

1112


what do the 'c' and 'v' in argc and argv stand for?

1173


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2321


What is the condition that is applied with ?: Operator?

1132


What is huge pointer in c?

1087


Define the scope of static variables.

1132