Code:
//Aim: to Find Factorial Of a No. Using function
#include<iostream.h>
#include<conio.h>
long int fact(int);
void main()
{
	int n;
	long int f=1;
	clrscr();
	cout<<"\n enetr a value:";
	cin>>n;
	f=fact(n);
	cout<<"\n the factorial is:"<<f;
	getch();
}
long int fact(int m)
{
	int i;
	long int f=1;
	for(i=1;i<=m;i++)
	{
	f=f*i;
	}
	return(f);
}

Last edited by shabbir; 14Feb2011 at 07:32.. Reason: Code blocks