Hi!
I'd like you to take a look at this code and tell me what should i do to make this shorter. This program count binomial coefficient. Thanks for all answers.
I think thatCode:#include "stdio.h" int main() { int k,n,i,w; while (scanf("%d%d",&n,&k)==2) { if(k>n/2) k=n-k; for(w=i=1;i<=k;i++) w=w*(n++-i)/i; printf("%d\n",w); } }might be write shorter, but i can't figure it out.Code:w=w*(n++-i)/i;
P.s. Sorry for my English...