Created
September 7, 2015 11:35
-
-
Save timvisee/d7fcd7c37cdbe45dee00 to your computer and use it in GitHub Desktop.
Challenge 1.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.timvisee.hhs; | |
public class Main { | |
/** The maximum value of the sum. */ | |
public static final int MAX = 10; | |
/** | |
* Main method called on start. | |
* | |
* @param args Startup arguments. | |
*/ | |
public static void main(String[] args) { | |
// Calculate the sum, and print the result | |
System.out.println("Sum of 1 to " + MAX + ": " + (MAX * (MAX + 1) / 2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment