Java program that prints the sum of the first ten positive integers
Posted by Samath
Last Updated: January 08, 2021
  476

Write a Java program that prints the sum of the first ten positive integers.

public class Main
{
  public static void main(String[] args) {
        System.out.print("Sum of the first ten positive integers: ");
        System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10);
  }
}