# Bell number calculation [closed]

Sorry if this forum is not relevant for programming question, but please if possible help me. I have the following code to calculate the Bell number:

#include <iostream>
using namespace std;
int bell(int n,int m){
if (n==1 && m==1)  return 1;
if (n >1 & m==1)  return  bell(n-1,n-1);
if (n>1  && (1< m && m<=n) )
return  bell(n-1,m-1)+bell(n,m-1);

}
int main(){

return 0;
}


It shows me the following error

Line 9: warning: control reaches end of non-void function


-

## closed as off topic by Yuval Filmus, t.b., Gerry Myerson, Zev ChonolesDec 13 '11 at 3:58

Questions on Mathematics Stack Exchange are expected to relate to math within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Where did you get this? –  Ｊ. Ｍ. Sep 3 '11 at 12:05
here cargalmathbooks.com/5%20Recursive%20Algorithms.pdf please see –  dato datuashvili Sep 3 '11 at 12:09

Consider what happens if $n \leq 0$ or $m \leq 0$.