To write a program that generates the factorial of a user input number (use and pointers and functions) follow the following commands.
#include<conio.h>
#include<stdio.h>
void fact(int*);
void main(void)
{
clrscr();
int no;
printf(“\nEnter a Number: “);
scanf(“%d”, %no);
factorial(%no);
getch();
}
void factorial(int *ptr)
{
int i;
int fact=*ptr;
int no1=fact-1;
for(i=0; i<=fact; i++)
{
if (no1!=0)
{
fact=fact*no1;
no1–;
}
}
printf(“\nFactrorial of %d is %d”, *ptr,fact);
}