C program to find factorial of number given by the user.

Here is the code for finding the factors of a given number :


Output:
Enter a number whose factorial you want: 5
   120
//C program to find factor of a number
#include<stdio.h>
void main()
{
int i,number,f=1;
printf("Enter number whose factorial you want :\t");
scanf("%d",&number);
for(i=1;i<=number;i++)
{
f=f*i;
}
printf("Factorial is :\t%d",f);
}
view raw Factor.c hosted with ❤ by GitHub

Comments

Popular posts from this blog

C++ programming toll plaza simulation program