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 |
totally how much header files r in c language
What is the difference between array and structure in c?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Describe how arrays can be passed to a user defined function
How Many Header Files in c?
What functions are in conio h?
What are header files in c?
what are bps & baud rates? differentiate these two?
What is f'n in math?
what r the cpu registers r ther?
Why is c so powerful?
Q-1: Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college.