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
Is stack a keyword in c?
Can we replace the struct function in tree syntax with a union?
What are structures and unions? State differencves between them.
What is the difference between constant pointer and constant variable?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
How can I handle floating-point exceptions gracefully?
What is structure and union in c?
Can stdout be forced to print somewhere other than the screen?
What is an array in c?
What is the difference between procedural and declarative language?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What are the benefits of organizational structure?
What is storage class?
What are structure types in C?
What is variable and explain rules to declare variable in c?