addemup.c 613 B

1234567891011121314
  1. /* addemup.c -- five kinds of statements */
  2. #include <stdio.h>
  3. int main(void) /* finds sum of first 20 integers */
  4. {
  5. int count, sum; /* declaration statement */
  6. count = 0; /* assignment statement */
  7. sum = 0; /* ditto */
  8. while (count++ < 20) /* while */
  9. sum = sum + count; /* statement */
  10. printf("sum = %d\n", sum);/* function statement */
  11. return 0; /* return statement */
  12. }