Question #308229

Write a program that reads a positive integer and computes the factorial


Expert's answer

#include <stdio.h>

int main() {
    int n, i;
    long long fact=1;
    scanf("%i",&n);
    for(i=2;i<=n;++i) fact*=i;
    printf("%i", fact);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS