Write a C program to find the factorial of a number


#include<stdio.h>
int main()
{
int fact=1,number,i;
printf("Enter the number: ");
scanf("%d", &number);
for(i=1;i<=number;i++)
{
    fact=fact*i;
}
printf("Factorial of %d is: %d", number,fact);
return 0;
}

Comments

Popular posts from this blog

Automations and robotics

Palindrome Pattern Program In Java Language

Rhombus Pattern Program In Java Language