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 wrong with this statement? Myname = 'robin';
If null and 0 are equivalent as null pointer constants, which should I use?
What is the difference between array and pointer?
Are there any problems with performing mathematical operations on different variable types?
How can you allocate arrays or structures bigger than 64K?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Differentiate call by value and call by reference?
What are different types of variables in c?
What is an expression?
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); }
i got 75% in all semester am i eligible for your company
What is %s and %d in c?
What is data structure in c programming?
Why c is a procedural language?
What does *p++ do? What does it point to?