What is the output of the following progarm?
#include<stdio.h>
main( )
{
int x,y=10;
x=4;
y=fact(x);
printf(ā%d\nā,y);
}
unsigned int fact(int x)
{
return(x*fact(x-1));
}
A. 24
B. 10
C. 4
D. none
Answer Posted / venu
ans:D.
when x= 1, x-1 =0, so total value = 0;
in fact() they are not checking if x==1 && x==0.
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
is it possible to create your own header files?
What is a volatile keyword in c?
What are c identifiers?
What is malloc() function?
Explain what is a stream?
How can you increase the allowable number of simultaneously open files?
What language is windows 1.0 written?
Why isn't it being handled properly?
What are the two types of functions in c?
Why main is used in c?
Is there any demerits of using pointer?
Explain how can you determine the size of an allocated portion of memory?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
Tell me when would you use a pointer to a function?
What is volatile, register definition in C