Program to finding factorial of a number

0
22
#include<stdio.h>
#include<conio.h>
void main()
{
 int n,i;
 double f=1;
 clrscr();
 printf("\n Enter n\n");
 scanf("%d", &n);
   for(i=1;i<=n;++i)
       f=f*i;   /* finds the factorial */
 printf("\n factorial of %3d=%.01f",n,f);
getch();
}
 Output 1:
 Enter n
 factorial of 4=24
 Output 2:
 Enter n 
 factorial of 6=720

 

 

 

Program to finding factorial of a number Program for find factorial of a given number Program to finding factorial of a number using for loop Program to finding factorial of a number using loop Program to finding factorial of a number in c C Program to finding factorial of a number Find factorial of given number

LEAVE A REPLY

Please enter your comment!
Please enter your name here