Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include <iostream>
- using namespace std;
- int Calculate(int n, int k){
- if(k == 0) return 1;
- return (n * Calculate(n - 1, k - 1)) / k;
- }
- int main()
- {
- int n;
- int k;
- printf("Insert n:");
- cin >> n;
- printf("Insert k:");
- cin >> k;
- printf("Value of C is %d ", Calculate(n, k));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement