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
develop algorithms to add polynomials (i) in one variable
What is the use of the function in c?
Why do we use null pointer?
What are the advantages of Macro over function?
What is static identifier?
What is 2 d array in c?
What is volatile variable how do you declare it?
What is calloc() function?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is external variable in c?
difference between object file and executable file
formula to convert 2500mmh2o into m3/hr
What are shell structures used for?
What is the difference between array and pointer in c?
What is the full form of getch?