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 I send mail from within a c program?

984


What is the best way of making my program efficient?

962


What is non linear data structure in c?

967


Can a pointer be volatile in c?

931


What is the meaning of c in c language?

1074


What is pass by reference in functions?

771


Compare array data type to pointer data type

967


What is declaration and definition in c?

1015


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1847


What does 2n 4c mean?

1188


What is getch?

1089


Is it possible to initialize a variable at the time it was declared?

1173


Why we not create function inside function.

2142


What are c identifiers?

1039


What is a substring in c?

998