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 ambagious result in C? explain with an example.
Why string is used in c?
List some of the dynamic data structures in C?
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
2 Answers Scientific Atlanta, Wipro,
Do you know what is a programing language ?
What is C++
What is scope rule in c?
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?
Explain how are portions of a program disabled in demo versions?
How can I implement opaque (abstract) data types in C? What's the difference between these two declarations? struct x1 { ... }; typedef struct { ... } x2;
to get a line of text and count the number of vowels in it
how to use showbits function?