diff --git a/src/Julia/Problems001-050/Problem006.jl b/src/Julia/Problems001-050/Problem006.jl index 56307ab..ccee019 100644 --- a/src/Julia/Problems001-050/Problem006.jl +++ b/src/Julia/Problems001-050/Problem006.jl @@ -22,11 +22,13 @@ function Problem6() Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. Statement =# + n = 100 - square_of_sum = sum(i for i in (1:n))^2 - sum_squares = sum(i^2 for i in 1:n) - diff = square_of_sum - sum_squares - return diff + square_of_sum = sum(i for i = 1:n)^2 + sum_squares = sum(i^2 for i = 1:n) + ans = square_of_sum - sum_squares + + return ans end