Computer Science & C Programming


Go further: extending C syntax

  1. The program can be simplified as follow:

int r=1; // combine declaration & initialization
int i=1;
loop:
  r *= i; // syntactic sugars
  i ++;
  if (i<=n) goto loop; // suppress 'else' and '{}'

return r; // specify the computed value

4 - 6