#include<iostream.h>

#include<conio.h>

void fact(int)

void main()

{

int a;

cout<<“Enter any number”;

cin>>a;

fact();

getch();

}
void fact(int x)

{

int i, result;

for(i=1;i<=x;i++)

{

result=result*i;

}

cout<<“Factorial of number = “<<result;

}

Advertisements