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
Where is c used?
what do u mean by Direct access files? then can u explain about Direct Access Files?
Which function in C can be used to append a string to another string?
code for replace tabs with equivalent number of blanks
What does malloc () calloc () realloc () free () do?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What does & mean in scanf?
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.
What are the functions to open and close the file in c language?
What is nested structure in c?
What is the difference between struct and union in C?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Why is %d used in c?
What is else if ladder?
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?