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 / shilpa m
Right answer is 0.
fun(int x)
{
if(x > 0)
fun(x/2);
printf("%d\n", x);
}
Here if fun(10)is called the sequence goes as fun(10)->fun
(5)->fun(2.5)->fun(1.25)->fun(0.625) after this itself
printf will be executed and 0 is printed.
please expalin how answer is 0 1 2 5 10 is right answer???
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Explain can the sizeof operator be used to tell the size of an array passed to a function?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
Write a program to print fibonacci series without using recursion?
What is use of pointer?
What are the benefits of c language?
Why we use break in c?
What is string length in c?
How can I read data from data files with particular formats?
What are the advantage of c language?
How is actual parameter different from the formal parameter?
What is register variable in c language?
Define Spanning-Tree Protocol (STP)
how to write optimum code to divide a 50 digit number with a 25 digit number??
Does c have function or method?
largest Of three Number using without if condition?