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

Hi all,

since the code is calling the same function with different
values,it's not at all possible to move to printf statement
until x becomes < 0

so only when the compiler gets the value of x as 0 the loop
will be stopped.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is c used?

639


what do u mean by Direct access files? then can u explain about Direct Access Files?

1629


Which function in C can be used to append a string to another string?

633


code for replace tabs with equivalent number of blanks

1625


What does malloc () calloc () realloc () free () do?

546






void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1240


What does & mean in scanf?

589


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14923


What are the functions to open and close the file in c language?

581


What is nested structure in c?

594


What is the difference between struct and union in C?

546


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

603


Why is %d used in c?

551


What is else if ladder?

598


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2159