Skip to content

A C program that calculates mathematical combinations C(n, r). It implements a helper factorial function to solve the formula n! / (r! * (n-r)!).

License

Notifications You must be signed in to change notification settings

ShotsMan2/Combination-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Combination Calculator

This project calculates the number of combinations (selection of items) using the mathematical formula $C(n, r)$.

⚙️ Logic

The program uses the standard formula:

$$C(n, r) = \frac{n!}{r! \cdot (n-r)!}$$

  1. Factorial Function: Computes $n!$ iteratively.
  2. Combination Function: Applies the formula using the factorial results.

🚀 Example Output

Input: $n=4, r=2$

  • $4! = 24$
  • $2! = 2$
  • $(4-2)! = 2$
  • Calculation: $24 / (2 \times 2) = 6$
--- Kombinasyon Hesaplama ---
C(4, 2) isleminin sonucu: 6

About

A C program that calculates mathematical combinations C(n, r). It implements a helper factorial function to solve the formula n! / (r! * (n-r)!).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages