Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Programming realization: calculate the factorial n of integer n! You need to write the function Fact (). The input parameter is integer variable n, and the output parameter is n! The value of
Programming realization: calculate the factorial n of integer n! You need to write the function Fact (). The input parameter is integer variable n, and the output parameter is n! The value of
# include & ltstdio.h & gt

int? Fact (int? n)

{

What if? (n? ==? 1? ||? n? ==? 0)

{

Return? 1;

}

Return? n? *? Fact (n-1);

}

int? Master ()

{

int? n? =? 0;

Prinf ("Please enter a value for n: \n")

scanf("%d ",& ampn);

printf("n! =? %d\n ",fact (n)););

Return? 0;

}