C Program to find the Factorial of a given Number

Write a C Program to find the Factorial of a given Number

This page has a C program to find the factorial of a given number. Factorial of a number is the product of all integers below of the number and the number. For example: Factorial of 7 is calculated from 1*2*3*4*5*6*7. Factorial of 7 is indicated by 7! The below given C Program is used to find the Factorial of a given Number. Kindly check out the program to find the Factorial of a given Number.


Program to find Factorial of a Number


#include<stdio.h>
int main(){
       int a=1,numbr;
       long int fact=1;

       printf("Enter a number:     ");
       scanf("%d",&numbr);
       while(a<=numbr){
       fact=fact*a;
       a++;
       }
       printf("\n Factorial of %d is: %ld",numbr,fact);
       return 0;
  }

   


Sample Output:

Enter a number:  4

Factorial of  4 is: 24

Enter a number:  6

Factorial of  6 is: 720


Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

  • Download Pdf
  • Interviews
  • Antivirus Program
  • Armstrong atlantic state university
  • Business card templates
  • C Program
  • Check
  • Color
  • Drag
  • Media
  • Download Pdf
  • Interviews
  • Antivirus Program
Bookmark and Share