C Program to find Factorial of the number using For -Loop|E-studyblog|

 C Program to find Factorial of the number using For -Loop|E-studyblog|


C Program to find Factorial of the number using For -Loop|E-studyblog|

                                            C Program to find Factorial of the number using For -Loop|E-studyblog|


Factorial number?

A Factorial is a function that multiplies a number by every number.

For Example:- 
0!=1
1!=1
2!=2*1=2
31=3*2*1=6
4!=4*3*2*1=24
5!=5*4*3*2*1=120

Formula :- n!=n*(n-1)* ....*1

Factorial of the number

#include <stdio.h>
int main()
{
	int n,i,f=1;
	printf("\nEnter the value of n:");
	
        scanf("%d",&n); 
	
	for(i=1;i<=n;i++)
	f=f*i;         
	printf("\nFactorial =%d",f);
}


Output:

C Program to find Factorial of the number using For -Loop|E-studyblog|


I hope you have read our Article  and  you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

No comments:

Post a Comment

If you have any queries ,please let us know

C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog

I n this Article, you will learn how to   Check  whether the number is  Even or odd. We have shared the source code of odd and even number i...