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 / mahesh patil
Only answer 1
answer 4
answer 7 are correct others are wrong..
If you are confident on your answers please check once then
write a post.
Correct Answer: 0 1 2 5 10
This will print in reverse order because, This is a
recursive call, Every time a function is called the values
are stored in stack/stack is created. when x value reaches
0 then it will return. So stack is LIFO order, So it will
print the values in reverse order.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Define VARIABLE?
Should I learn data structures in c or python?
What are identifiers c?
What is the heap in c?
What is unary operator?
What is unsigned int in c?
What is the difference between null pointer and wild pointer?
Compare interpreters and compilers.
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Suggesting that there can be 62 seconds in a minute?
Can include files be nested?
Is c call by value?
What are the 5 organizational structures?
What are the 32 keywords in c?
What is the auto keyword good for?