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
Write a program to generate random numbers in c?
what do you mean by inline function in C?
What are data types in c language?
How do I round numbers?
What is string in c language?
How do you do dynamic memory allocation in C applications?
Explain high-order and low-order bytes.
What is the difference between mpi and openmp?
What does 3 mean in texting?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is console in c language?
What is static memory allocation? Explain
explain what is a newline escape sequence?
Explain what is the benefit of using an enum rather than a #define constant?
What is the meaning of ?