Powered By Blogger

Feb 11, 2025

4. Factorial of a Number

 #include <stdio.h>

int main() {

    int n, i;

    unsigned long long fact = 1;

    printf("Enter a number: ");

    scanf("%d", &n);

    for(i = 1; i <= n; ++i)

        fact *= i;

    printf("Factorial: %llu\n", fact);

    return 0;

}


No comments:

Post a Comment

Featured Post

Data Analysis

    What is data analysis and its significance?   Data analysis is the process of collecting, transforming, and organizing data to dr...

Popular Posts