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

main() { printf("hello"); fork(); }

699


What is scope rule of function in c?

555


What are the 3 types of structures?

574


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

598


What is the use of function overloading in C?

686






Is c easier than java?

578


What are the usage of pointer in c?

708


pierrot's divisor program using c or c++ code

1734


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

817


What is main function in c?

551


Why do we use namespace feature?

586


What is c language in simple words?

598


In C language, a variable name cannot contain?

747


Explain c preprocessor?

687


What is the difference between struct and union in C?

580