0
10kviews
Write a program to find the factorial of a number, using recursive function

Subject : Structured Programming Approach

Title : Functions and Parameter

Marks : 10M

1 Answer
0
3.6kviews
#include<stdio.h>
#include<conio.h>
void main()
{
int no,factorial;
int fact (int no);
clrscr();
printf("Enter a number:");
scanf("%d",&no);
factorial=fact(no);
printf("Factorial=%d",factorial);
getch();
 }
 int fact (int no)
{
if(no==1)
return 1;
else
return (no * fact (no-1));
}
Please log in to add an answer.