Answer to Question #308229 in C for ahmed

Question #308229

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


1
Expert's answer
2022-03-14T08:37:10-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS