Skip to content

Commit

Permalink
Chapter 1, exercise 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblair committed Oct 8, 2010
1 parent 1c8cf7c commit 6bfdf62
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ch1/exercises/ex3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>

int main(void) {
int i, sum = 0;

for (i=1;i<=100;i++) {
sum += i;
}

printf("The sum of the numbers between 1 and 100 is %d\n", sum);

return 0;
}

0 comments on commit 6bfdf62

Please sign in to comment.