This program is for finding the factorial of N number. Two integer type variables declared with static value one of them. Here to user enter the value for finding the factorial. Then loop statement for stepping forward to find the result and (f*I) and at last to print the output on the display.
Problem Statement:
This is C Program that has to find the factorial of N numbers.
- Enter the numbers.
- Using loop statement.
- Display result on the screen.
Here is source code of the C program that has to find the factorial of N numbers. The C program is successfully compiled. The program output is also shown below.
#include<stdio.h>
void main()
{
int num,i,f=1;
clrscr();
printf("Enter the a Num : ");
scanf("%d",&num);
i=num;
while(i>=1)
{
f=f*i;
i--;
}
printf("%d",f);
getch();
}