forgotten-code
This commit is contained in:
parent
e7868dfde4
commit
cddad223f8
1 changed files with 16 additions and 0 deletions
16
semaine-2/forgotten-code/main.c
Normal file
16
semaine-2/forgotten-code/main.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define TARGET 9999
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
|
||||||
|
int i, sum = 0;
|
||||||
|
|
||||||
|
for (i = 0; i <= TARGET; i += 2) {
|
||||||
|
sum += i;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%i", sum);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue