Skip to content

Instantly share code, notes, and snippets.

@timkofu
Last active April 26, 2018 13:33
Show Gist options
  • Save timkofu/690c1c3dfd04893de77fd630564c5432 to your computer and use it in GitHub Desktop.
Save timkofu/690c1c3dfd04893de77fd630564c5432 to your computer and use it in GitHub Desktop.
#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