Factorial !
You have been given a positive integer . You need to find and print the Factorial of this number. The Factorial of a positive integer refers to the product of all number in the range from to . You can read more about the factorial of a number here.
Source code in C:
Input Format:
The first and only line of the input contains a single integer denoting the number whose factorial you need to find.
The first and only line of the input contains a single integer denoting the number whose factorial you need to find.
Output Format
Output a single line denoting the factorial of the number .
Output a single line denoting the factorial of the number .
Constraints
Source code in C:
#include<stdio.h>
int main()
{
int N,i,fact;
fact=1;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
fact=fact*i;
}
printf("%d",fact);
return 0;
}
Comments
Post a Comment