hgggggggggggggggg

#include <stdio.h>

// Function to calculate the factorial of a number
int factorial(int n) {
    if (n == 0 || n == 1) {
        return 1;
    } else {
        return n * factorial(n - 1);
    }
}

// Main function
int main() {
    // Declare variables
    int num;

    // Prompt user for input
    printf("Enter a non-negative integer: ");

    // Read input from user
    scanf("%d", &num);

    // Check if the input is non-negative
    if (num < 0) {
        printf("Error: Please enter a non-negative integer.\n");
    } else {
        // Calculate and print the factorial
        printf("The factorial of %d is: %d\n", num, factorial(num));
    }

    // Return 0 to indicate successful completion
    return 0;
}