Code

#include<stdio.h>
#include<conio.h>

void main()
{
    int fact, i, n;
    fact = 1;

    printf("Enter the number: ");
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
    {
         fact = fact * i;
    }

    printf("\n\nFactorial of %d is %d\n", n , fact);
    getch();

    return 0;
}
  • LDAP
  • Standard
Forgot your password?

About GitLab