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

How can my program discover the complete pathname to the executable from which it was invoked?

1082


What does 4d mean in c?

1507


Can we declare function inside main?

1009


What are the Advantages of using macro

1177


What does *p++ do? What does it point to?

1066


List some of the static data structures in C?

1204


Write a program of prime number using recursion.

1097


What are the different categories of functions in c?

1138


swap 2 numbers without using third variable?

1141


Explain b+ tree?

1079


Is it better to bitshift a value than to multiply by 2?

1095


How reliable are floating-point comparisons?

1106


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2452


What is equivalent to ++i+++j?

1098


Explain is it better to bitshift a value than to multiply by 2?

1205