Skip to content

Instantly share code, notes, and snippets.

@jimmykurian
Created February 3, 2012 21:41
Show Gist options
  • Save jimmykurian/1732848 to your computer and use it in GitHub Desktop.
Save jimmykurian/1732848 to your computer and use it in GitHub Desktop.
A Java program named Sum10 that computes the sum of the first ten positive integers 1+2+ … +10. Print the result to the standard output.
//Sum10.java - Jimmy Kurian
class Sum10{
public static void main(String[] args) {
int s = 1+2+3+4+5+6+7+8+9+10;
System.out.println(s);
}
}
@Gatewayran
Copy link

How do I write a program in java that will print special characters such as /|_/"()**## etc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment