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 / hemavathiarun
Hi all,
since the code is calling the same function with different
values,it's not at all possible to move to printf statement
until x becomes < 0
so only when the compiler gets the value of x as 0 the loop
will be stopped.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the sizeof () a pointer?
Why c is called a mid level programming language?
Are pointers integer?
What are the different types of linkage exist in c?
What is the purpose of void in c?
Explain what are the __date__ and __time__ preprocessor commands?
What is the purpose of macro in C language?
Can you define which header file to include at compile time?
I heard that you have to include stdio.h before calling printf. Why?
What is the difference between array and pointer?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What are the different types of errors?
What are the benefits of c language?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above