Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <stdio.h>
- #include <iostream>
- using namespace std;
- int main(int argc, char** argv) {
- int a=1, b=0, c, jumlah;
- while(c<3000000) {
- if(c % 2 == 0) {
- jumlah += c;
- }
- c = a+b;
- b = a;
- a = c;
- }
- cout << jumlah;
- cout << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment