0
610views
Write a Program to find the factorial of a number

Subject : Structured Programming Approach

Title : Control Structures

Marks : 06M

1 Answer
0
0views
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,fact;
clrscr();
printf("Enter a number: ");
scanf("%d",&n);
for(i=1,fact=1;i<=n;i++)
{
    fact=fact * i;
}
printf("Factorial of this number is:%d\n",fact);
}
Please log in to add an answer.