#include <stdio.h>

int fact(int n){
    int res=1;
    while (n!=0){
        res=res*n;
        n--;
    }
    return res;
}

int main() {
    int n, res=1;
    printf("enter the value of factorial: ");
    scanf("%d",&n);
    printf("\n%d",fact(n));
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: