Skip to the content of the web site.

Project K.4: Binomial coefficients

Implement the McCarthy 91 function, which is defined as

$M(n)=\begin{cases}n-10,&{\mbox{if }}n>100{\mbox{ }}\\M(M(n+11)),&{\mbox{if }}n\leq 100\mbox{ }\end{cases}$.

Your function declaration should be

int mccarthy_91( int n );

Try evaluating this function for various integer values and see whether or not you can rewrite this recursive function using just a conditional test.