Skip to content

Instantly share code, notes, and snippets.

@faiq-shaikh
faiq-shaikh / factorial.c
Created October 14, 2025 15:10
this program calculate the factorial of a number
#include<stdio.h>
int main()
{int n,i,fact;
printf("enter a number: ");
scanf("%d",&n);
for( i=1;i<=n;i++)
{
fact*=i;
}
printf("factorial: %d",fact);