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
What is a union?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
Why void main is used in c?
What is an arrays?
largest Of three Number using without if condition?
What is c variable?
What is the difference between break and continue?
Can you add pointers together? Why would you?
What does %c mean in c?
What is realloc in c?
What are the 4 types of unions?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What does the && operator do in a program code?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
Can we access array using pointer in c language?