Last active
April 26, 2018 13:33
-
-
Save timkofu/690c1c3dfd04893de77fd630564c5432 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
unsigned long long int last_number = 0; | |
unsigned long long int current_number = 1; | |
unsigned long long int currnum_buff = 0; | |
for(int i=0; i<1000000000; i++){ | |
currnum_buff = current_number; | |
current_number += last_number; | |
last_number = currnum_buff; | |
} | |
cout << "The billionth fibonacci number is: " << current_number << endl; | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment