fun(int x)
{
if(x > 0)
fun(x/2);
printf("%d", x);
}
above function is called as:
fun(10);
what will it print?
}
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / enigma
Strictly speaking the answer is undefined until someone forces the output text from the console buffer to the screen.
Otherwise it would normally print 012510
Debug it inside MSVC and witness no output. In reality though most implementations will do a final flush to screen....
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mortal
it will print "0" i.e zero since compiler wont get to the
print statement until the value is zero.
| Is This Answer Correct ? | 2 Yes | 5 No |
Explain what does the function toupper() do?
Write a simple code fragment that will check if a number is positive or negative.
What do you mean by keywords in c?
What does %c mean in c?
input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%
What is clrscr ()?
7. Identify the correct argument for the function call fflush() in ANSI C: A)stdout B)stdin C)stderr D)All the above
write a C program : To find out the number of identical words in two files . the file name should be taken as command line argument .
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
Explain what are the different data types in c?
Why c is procedure oriented?