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 format specifier for printing a pointer value?
What is the maximum no. of arguments that can be given in a command line in C.?
Why can’t we compare structures?
What is the difference between union and anonymous union?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
How many header files are in c?
What is the right type to use for boolean values in c? Is there a standard type?
How do you define a string?
What are the standard predefined macros?
What are keywords c?
What is a global variable in c?
What does & mean in scanf?
What is the difference between declaring a variable and defining a variable?
What is the difference between scanf and fscanf?
How can I make it pause before closing the program output window?