C Example: Big Factorial: decimal digit array with carry propagation
Stores a big integer as an array of decimal digits, multiplies from 2 through 50 digit by digit with carry propagation, and produces exact 50! (65 digits). Also prints digit counts for 10! through 50! to show factorial growth — an introduction to hand-written big-number arithmetic.
🖥 Run OnlineGCC 10.2 · C11 standard · click ▶ to run · Copy code
🖨 Reference OutputMatches the online run in a standard C11 environment
50! = 30414093201713378043612608166064768844377641568960512000000000000 digits: 65 10! has 7 digits 20! has 19 digits 30! has 33 digits 40! has 48 digits 50! has 65 digits
🧩 Keep Learning