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
What is bubble sort technique in c?
Why is structure padding done in c?
How important is structure in life?
The __________ attribute is used to announce variables based on definitions of columns in a table?
writ a program to compare using strcmp VIVA and viva with its output.
What are the back slash character constants or escape sequence charactersavailable in c?
can we have joblib in a proc ?
Tell us two differences between new () and malloc ()?
How do you generate random numbers in C?
What is pointers in c with example?
What is the difference between functions getch() and getche()?
What is #include called?
What is an array? What the different types of arrays in c?
what are the facialities provided by you after the selection of the student.
What are the 5 types of organizational structures?