1. ## Combinations

Hi , I have to write a program that calculates the number of possible combinations k of n objects.
It has to be a recursive program.
It compiles and runs, but while debugging while I type in some numbers it returns 0 everytime

Thanks for any help

Code:
```#include <stdio.h>
int possibleCombi(int n,int k);
int main (void)
{
int n,k,combinations;
printf("type in n , number of total objects");
scanf("%d",&n);
printf("type in k , numbers drawn");
scanf("%d",&k);
combinations = possibleCombi(n,k);
printf("%d",combinations);
}

int possibleCombi(int n,int k)
{
if ((k = 0) || (n = k)){
return 1;
}
if(n > k > 0){
return (possibleCombi(n - 1,k) + possibleCombi(n - 1,k - 1));
}

}```

2. I'm pretty sure this is not what you want:

Code:
`  	if(n > k > 0){`
This evaluates to ...

Code:
`  if ((n > k) > 0) {`
which means: if the boolean result of n > k (either "true" or "false") is > 0 do....

You probably want something like

Code:
`  if ((n > k) && (k > 0)) {`

3. Thanks , I made that change to my code, but it still returns a zero everytime

4. You're assigning k and n to 0 in the if statement try:

if ((k == 0) || (n == k)){

5. Thanks , it works now , except that the answer isn't right I think.
Shouldn't the answer for example with n = 8 and k = 3 be 512.