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 / gg

0 1 2 5 10 is the answer. But can anybody explain why the
printing order 0 1 2 5 10. Why not 10 5 2 1 0 ? please...

Is it depends on stack allocation??

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If fflush wont work, what can I use to flush input?

617


What is call by value in c?

558


What is structure data type in c?

572


What is the main difference between calloc () and malloc ()?

573


Is c weakly typed?

579






What is masking?

637


Explain the difference between structs and unions in c?

576


What are the two types of functions in c?

566


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

579


What does dm mean sexually?

814


What is meant by recursion?

632


Explain Basic concepts of C language?

646


List the difference between a While & Do While loops?

639


What is sizeof array in c?

594


what are enumerations in C

724