-
-
Save hoctructuyencntt/09edaac473708eb55629376ae0607f8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
long int Fact(int n); | |
int main() { | |
int n; | |
printf("Nhập một số nguyên dương: "); | |
scanf("%d",&n); | |
printf("Giai thừa %d = %ld", n, Fact(n)); | |
return 0; | |
} | |
long int Fact(int n) { | |
if (n>=1) | |
return n*Fact(n-1); | |
else | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment