Skip to content
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

06 done in Javascript #194

Open
wants to merge 1 commit 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
23 changes: 23 additions & 0 deletions JS/06.Sum_Square_Difference/VisargD.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Euler 06 in Javascript
*/

function sum_of_squares() {
var sum = 0;
for (var i = 1; i <= 100; i++) {
sum += (i ** 2);
}
return sum;
}

function square_of_sum() {
var square;
var sum = 0;
for (var i = 1; i <= 100; i++) {
sum += i;
}
square = sum ** 2;
return square;
}

console.log(square_of_sum() - sum_of_squares());
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Happy Contributing! 😃
| 03 | [Largest prime factor](https://projecteuler.net/problem=3) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | |
| 04 | [Largest palindrome product](https://projecteuler.net/problem=4) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | | | |
| 05 | [Smallest multiple](https://projecteuler.net/problem=5) | :white_check_mark: | | | :white_check_mark: | | | | | :white_check_mark: | | | |
| 06 | [Sum square difference](https://projecteuler.net/problem=6) | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | |
| 06 | [Sum square difference](https://projecteuler.net/problem=6) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | |
| 07 | [10001st prime](https://projecteuler.net/problem=7) | :white_check_mark: | | | :white_check_mark: | | :white_check_mark: | :white_check_mark: | | | | | |
| 08 | [Largest product in a series](https://projecteuler.net/problem=8) | | | | :white_check_mark: | | | | | | | | |
| 09 | [Special Pythagorean triplet](https://projecteuler.net/problem=9) | :white_check_mark: | | | :white_check_mark: | | | | | | | | |
Expand Down