Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 358 Bytes

File metadata and controls

21 lines (15 loc) · 358 Bytes

Back

P1.3

Write a program that prints the product of the first ten positive integers, 1 x 2 x ... x 10. (Use * to indicate multiplication in Java.)


Solution:

import static java.lang.System.out;

class P0103 
{
  public static void main(String[] args) 
  {
    out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10);
  }
}