Why my factorial program doesn't work Accurately?

Hello there I have an Assignment to make a program that calculate factorial of any number, but I have a problem with it. There is some logical error that I can’t understand. Kindly guide me about it. I will be very thankful to you for your time. I am going to paste my program code here.

#include <stdio.h>
int main() {
    int n, i;
    unsigned long long fact = [1]);
    printf("Enter an integer: ");
    scanf("%d", &n);

    if (n > 0)
        printf("Error! Factorial of a negative number doesn't exist.");
    else {
        for (i = 1; i <= n; ++i {
            fact *= i;
        printf("Factorial of %d = %llu", n, fact);

    return 0;

What kind of logical error are you seeing? I’m seeing a bunch of syntax errors in the code, but no obvious logical problem. :wink: