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...

fun(int x)
{
if(x > 0)
fun(x/2);
printf("%d", x);
}

above function is called as:
fun(10);

what will it print?



}

Answer Posted / shilpa m

Right answer is 0.
fun(int x)
{
if(x > 0)
fun(x/2);
printf("%d\n", x);
}
Here if fun(10)is called the sequence goes as fun(10)->fun
(5)->fun(2.5)->fun(1.25)->fun(0.625) after this itself
printf will be executed and 0 is printed.

please expalin how answer is 0 1 2 5 10 is right answer???

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain can the sizeof operator be used to tell the size of an array passed to a function?

1117


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1128


Write a program to print fibonacci series without using recursion?

1219


What is use of pointer?

1172


What are the benefits of c language?

1228


Why we use break in c?

1074


What is string length in c?

1159


How can I read data from data files with particular formats?

1092


What are the advantage of c language?

1105


How is actual parameter different from the formal parameter?

1062


What is register variable in c language?

1062


Define Spanning-Tree Protocol (STP)

1178


how to write optimum code to divide a 50 digit number with a 25 digit number??

3301


Does c have function or method?

1062


largest Of three Number using without if condition?

1667