by Dinesh Thakur Category: C Programming (Pratical)

This is C Program Find the Factorial of N Number. 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.

  1. Enter the numbers.
  2. Using loop statement.
  3. 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>

main()
{
        int num,i,f=1;
        clrscr();
        printf("Enter the a Num : ");
        scanf("%d",&num);
        for(i=num;i>=1;i--)
            {
                 f=f*i;
            }
                 printf("%d",f);
                 getch();
}
Output :
Enter the a Num : 5
120


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.