Monday, May 20, 2019

FIND FACTORIAL OF A NUMBER IN C PROGRAMING

#include <stdio.h>
#include <conio.h>
int main()
{
int i ,n,f=1;
printf("Enter the no.: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
  {
   f=f*i;
  }
printf("Factorial=%d",f);
}


Output:

Enter the no.: 5
Factorial=120

No comments:

Post a Comment