#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int n, j;
long int fact(int);
long int (*ptr) (int); // pointer to function declaration.
ptr = &fact; // function address assigned to pointer.
cout<<"Enter the no."<<endl;
cin>>n;
j=(*ptr) (n); // function calling using pointer
cout<<"The factorial of the entered no. is :"<<endl<<j;
getch();
return 0;
}
long int fact(int x)
{
int i, fact;
fact = 1;
for(i=1; i<=x; i++)
{
fact=fact * i;
}
return fact;
}