123456789101112
int C[11][11]; int n,k; //initialize the array to 0. Some compilers already do this, but it's nice to make sure for (n=0;n<11;n++) { C[n][0]=1; for(k=0;k<11;k++) C[n][k]=0; } for (n=1;n<11;n++) for(k=1;k<=11;k++) C[n][k]=C[n-1][k-1]+C[n-1][k];