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
Answers were Sorted based on User's Feedback
Answer / 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 |
What is a structural principle?
What is the use of keyword VOLATILE in C?
When is an interface "good"?
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??
which is conditional construct a) if statement b) switch statement c) while/for d) goto
how to print 212 as Twohundreds twelve plz provide me ans soon
1,4,8,13,21,30,36,45,54,63,73,?,?.
10 Answers AMB, Franklin Templeton,
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
How can I delete a file?
i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4
What is the difference between the = symbol and == symbol?
What is the difference between volatile and const volatile?