Kotlinlearncs.online LogoJava
Return to List

Solve: Sum of Integers

Created By: Justin Maier
/ Version: 2024.7.0

Given a positive int variable n, write a snippet of Java code that prints the sum of the positive integers between 1 and n, inclusive. For example, if n = 4, since 1 + 2 + 3 + 4 = 10, your code should print out 10.

Related Lessons

Stuck? You may find these lessons helpful: