C Programming

C Program to Calculate Factorial Using Function

This is C Program and shows that how can you calcualte Factorial using Function.

A user here will enter the number and calculate the factorial using Function. Here are more examples that you can check on factorial.

C++ Program for Factorial using For, While & Do While
C Program to Calculate the Factorial using Function.
C Program to Calculate the Factorial using Recursion.

Source Code

long int factorial(int);
void main()
int n;
long int fact;
printf("Enter number:");
printf("Factorial number of %d=%ld",fact);
long int factorial(int n)
long int fact=1;
for(i=1; i<n; i++)
return fact;

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.