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
Can you please explain the difference between malloc() and calloc() function?
What is the use of typedef in c?
What does %d do?
What are the different types of objects used in c?
What is c value paradox explain?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
All technical questions
Explain what are header files and explain what are its uses in c programming?
Explain how do you determine whether to use a stream function or a low-level function?
Explain modulus operator.
What are the advantages of union?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
what do you mean by inline function in C?
Difference between pass by reference and pass by value?