Skip to content

AnonymousM21/factorial-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Factorial Calculator Using C Programming Language

Question

Write a program to find the factorial value of any number entered through the keyboard.

Features

  • Supports large numbers to be factorialized, above 22!
  • Tested upto 1754! for 64 bit computers and upto 170! for 32 bit computers.

Algorithm:

   int i;
   double fact = 1;
   for(; i >= 1; --i) {
       fact *= i;
   }
   printf("%.9g", fact);

For full code functionality, see factorial.c

Usage

You can clone or download the repo, Once you have the file "factorial.c", You just need to compile and run it.

Compile

$ gcc factorial.c -o factorial

Run on Linux

$ ./factorial

Run on Windows

$ .\factorial.exe

Feel free to raise issues if you find some errors or want to clear your doubts...

#factorial calculator #c project #mini project #factorial

Contact me on Telegram

About

Calculate factorial of a given number

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages