/********************************/ /* sum.c */ /* Get the summation of numbers */ /* EECS10 Discussion week2 S1 */ /* Author: Weiwei Chen */ /* Date: Jul. 8. 2012 */ /********************************/ #include int main(void) { int sum = 0; int count = 1; int TOTALNUMBERS = 1000; while(count <= TOTALNUMBERS) { sum += count; count ++; } printf("The summation of the first %d positive natrual number is %d. \n", TOTALNUMBERS, sum); return 0; }