Home
Classrooms
Courses
About Us
Resources
Members
More
Write a program that calculates and prints out the sum of all numbers from 1 to 10.
class Main {
public static void main(String[] args) {
System.out.println(1+2+3+4+5+6+7+8+9+10);
}
class Main { public static void main(String[] args) { System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10); } }
I am not sure how this relates to the class but...
class Main { public static void main(String[] args) { System.out.println(1+2+3+4+5+6+7+8+9+10); } }
class Main { public static void main(String[] args) { System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10); } }
class Main {
public static void main(String[] args) {
System.out.println(1+2+3+4+5+6+7+8+9+10);
}
}
class Main { public static void main(String[] args) { System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10); } }
I am not sure how this relates to the class but...
class Main { public static void main(String[] args) { System.out.println(1+2+3+4+5+6+7+8+9+10); } }
class Main { public static void main(String[] args) { System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10); } }