Skip to content

Solution to 25 and 16 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CPP/25. 1000-digit Fibonacci number/17-Vishal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
using namespace std;
int main() {
int n1=0,n2=1,n3,i=1;
while(1)
{
n3=n1+n2;
if(1000-n3<=0)
{
break;
}
i++;
n1=n2;
n2=n3;
}
cout << i+1;
return 0;
}
12 changes: 12 additions & 0 deletions Python/16. Power digit sum/17-Vishal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def getSum(n):

sum = 0

while(n > 0):
sum += int(n%10)
n = int(n/10)

return sum


print(getSum(2**1000))
11 changes: 11 additions & 0 deletions Python/25. 1000-digit Fibonacci number/17-Vishal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
n1=0
n2=1
i=1;
while(1):
n3=n1+n2
if(1000-n3<=0):
break
i+=1
n1=n2
n2=n3
print(i+1)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ Happy Contributing! 😃
|22 |[Names scores](https://projecteuler.net/problem=22)| | | | | | | | | | | | |
|23| [Non-abundant sums](https://projecteuler.net/problem=23)| | | | | | | | | | | | |
|24| [Lexicographic permutations](https://projecteuler.net/problem=24)| | | | | | | | | | | | |
|25| [1000-digit Fibonacci number](https://projecteuler.net/problem=25)| | | | | | | | | | | | |

|25| [1000-digit Fibonacci number](https://projecteuler.net/problem=25)| :white_check_mark: | | | :white_check_mark: | | | | | | | | |

|26| [Reciprocal cycles](https://projecteuler.net/problem=26)| | | | | | | | | | | | |
|27| [Quadratic primes](https://projecteuler.net/problem=27)| | | | | | | | | | | | |
|28 |[Number spiral diagonals](https://projecteuler.net/problem=28)| | | | | | | | | | | | |
Expand Down