public class Solution {
public static void main(String[] args) {
//write your code here
int d = 1;
for (int i=1; i<=9; i++){
d= d*(i+1);
}
System.out.println(d);
}
}
Is there anyway that I could further simplify the code? Thanks
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Misiu
19 November 2020, 03:22useful
System.out.println(1*2*...*10);
or
System.out.println(2*...*10);
+1