Skip to content

Commit c397204

Browse files
committed
almost done
1 parent 2967263 commit c397204

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <stdio.h>
2+
3+
/**
4+
* main - main function
5+
* Return: always return 0
6+
*/
7+
int main(void)
8+
{
9+
int counter = 0;
10+
long int a = 1;
11+
long int b = a;
12+
long int c = a + b;
13+
while (c < 4000000)
14+
{
15+
if (c % 2 == 0)
16+
{
17+
counter += c;
18+
}
19+
a = b;
20+
b = c;
21+
c = a + b;
22+
}
23+
printf("%d\n", counter);
24+
return (0);
25+
}

0 commit comments

Comments
 (0)