# find the factorial of a given number using c programming

To find the factorial of number, multiply continuously from 1 to that number.

for eg:- Factorial of 3 (ie. 3!) = 1 * 2 * 3 = 6

Factoria of 5 (ie. 5!) = 1 * 2 * 3* 4* 5 = 120

and so on.

-------------------------------------------------------

#include<stdio.h>

#include<conio.h>

void main()

{

int f=1,i,n;

clrscr();

printf("Enter a number\n");

scanf("%d",&n)

while(i<=n)

{

f=f * i;

i=i+1;

}

printf("Factorial of %d is %d",n,f);

getch();

}

---------------------------------------------------------------------

int f=1 ----------> variable declaration & assigning values

scanf ---------------> getting value to the variable n from keyboard

f=f*i ----------------> value of f is multiplied by the value of i and save the result in to f.

----------------------------------------------------------------------

## More by this Author

thajuudin 5 years ago

out put is 1 for every number witgh dz program

Tamanna Jain 3 years ago

Incorrect program

agarwal 3 years ago

Incorrect coding

k.d.shukla 2 years ago

it does not work for long integers

Somnath Karmakar 2 years ago

This is a bad programme ever ... so this is wrong please don't copy this anywhere;;;;;;;;; bogaaaaaaaaaassssssss

Johna86 2 years ago

Really informative article post.Thanks Again. Awesome. dfedcdadbbee

Pharmd588 2 years ago

Very nice site! cheap goods http://yieopxa2.com/yxyaovx/4.html

blaze 2 years ago

abe kabhi jindhgi mai program banaye tha kya

Mantu 2 years ago

Your program is wrong. intialize i=1 above while loop. Then the program will execute correctly.

http://www.java-programming-tutorial.com/2014/07/j...

baba 2 years ago

sahi hai bhai bawkoof bnana raha hai

u.h shukla 2 years ago

Best programs

ashish 2 years ago

wrong program

ABC 2 years ago

JHATU PROGRAM

A.b 2 years ago

ok ,this is correct;

ashok rana 2 years ago

Nice program

raj 2 years ago

Isko program banane nahi aate ...

Aajaate hai program likhne...

Guru 2 years ago

Superb program

indumathy 2 years ago

very usefull for me

abi 23 months ago

nice

deepak 23 months ago