The result of the program should look like:

R1 R2 R3

1 1 1 payoff is 1

1 1 2 .......... 1

1 1 3 .......... 1

1 2 1 .......... 1

1 2 2 .......... 1

...

...

...

3 3 2 .............. 5

this is what I have so far:

#include <stdio.h> #include <stdlib.h> int payOff(int r1, int r2, int r3); void loopR3(int R3, int upto); void loopR2(int R2, int upto); int main(void) { loopR3(1,3); loopR2(1,3); return 0; } /*DID NOT INCLUDE PAYOFF AS IT IS IRRELEVENT FOR THE QUESTION*/ void loopR3(int R3, int upto) { int R1 =1; int R2 =1; if (R3 > upto){ return loopR2(R2, upto); }//end if else{ printf("%d\t %d\t %d\t payoff is %d\n", R1, R2, R3, payOff(R1,R2, R3)); loopR3(R3+1, upto); }//end else } void loopR2(int R2, int upto) { if (R2<=upto){ loopR3(R2+1,upto); printf("R2 is %d \n", R2); }//end if }