Factorial !

You have been given a positive integer N. You need to find and print the Factorial of this number. The Factorial of a positive integer N refers to the product of all number in the range from 1 to N. You can read more about the factorial of a number here.

Input Format:
The first and only line of the input contains a single integer N denoting the number whose factorial you need to find.

Output Format
Output a single line denoting the factorial of the number N.

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

Popular posts from this blog

Find Product ! Hacker Earth

Seating Arrangement

Roy and Profile picture