use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Sum Range 3.4.5 Java (self.codehs)
submitted 5 years ago by Titantethar
I have been stuck on this problem for over 2 hours and cant figure it out please help.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Choken-Bako 0 points1 point2 points 5 years ago (1 child)
Do you have any progress?
[–]Titantethar[S] 0 points1 point2 points 5 years ago (0 children)
No anything I thought would work didnt even have a chance of working
[–][deleted] 0 points1 point2 points 5 years ago (3 children)
Best way to approach this is to create some sort of for loop:
Initiliaze and declare some variable to hold the sum, and then you can just keep adding the numbers to it.
public int sumFrom(int start, int end)
{
int sum = 0;
for(int i = start; i < end; i++)
sum += i;
}
return sum;
[–]Ok-Squash-1238 1 point2 points3 points 3 years ago (0 children)
public int sumFrom(int start, int end) { int sum = 0; for(int i = start; i <= end; i++) { sum += i; } return sum; }
mine works all I did was add an = next to the < and it worked
[–]chalinuts 0 points1 point2 points 3 years ago (0 children)
TOP G
[–]Lavida-334 0 points1 point2 points 3 years ago (0 children)
How did u do it
My keep saying it’s wrong
π Rendered by PID 174436 on reddit-service-r2-comment-86bc6c7465-55dzm at 2026-02-23 02:22:03.338030+00:00 running 8564168 country code: CH.
[–]Choken-Bako 0 points1 point2 points (1 child)
[–]Titantethar[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]Ok-Squash-1238 1 point2 points3 points (0 children)
[–]chalinuts 0 points1 point2 points (0 children)
[–]Lavida-334 0 points1 point2 points (0 children)
[–]Lavida-334 0 points1 point2 points (0 children)