#include<stdio.h>
#include<conio.h>
void main()
{
int fac,n;
int factorial(int);
clrscr();
printf(“Enter any number:”);
scanf(“%d”,&n);
fac=factorial(n);
printf(“Factorial=%d”,fac);
getch();
}
int factorial(int x)
{
int f;
if(x==1||x==0)
return 1;
else
f=x*factorial(x-1);
return f;
}
how to do tower of hanoi program using recursion
Can anybody tell me how to find factorial of any number using goto statement
Please do not use ‘for,while’ or any other loop
Using goto in programs is not a good practice.