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

Strictly speaking the answer is undefined until someone forces the output text from the console buffer to the screen.
Otherwise it would normally print 012510

Debug it inside MSVC and witness no output. In reality though most implementations will do a final flush to screen....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of a ‘’ character?

589


Which is better between malloc and calloc?

673


What is a header file?

640


what is use of malloc and calloc?

1388


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1450






Write a program in c to replace any vowel in a string with z?

699


What is the use of putchar function?

655


Explain what are compound statements?

608


Is return a keyword in c?

602


How pointers are declared?

565


Can a file other than a .h file be included with #include?

688


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2229


List a few unconditional control statement in c.

564


swap 2 numbers without using third variable?

666


What is a file descriptor in c?

568