#include <stdio.h>
int main() {
int number, i;
unsigned long long fact = 1;
printf("Enter an integer: ");
scanf("%d", &number);
// shows error if the user enters a negative integer
if (number < 0)
printf("Error! Factorial of a negative number doesn't exist.");
else {
for (i = 1; i <= number; ++i) {
fact *= i;
}
printf("Factorial of %d = %llu", number, fact);
}
return 0;
}