Q&A Discussions
JS Advent calendar
1 Vote
1 Answeri want to print sum of all integers from 1to 100 like for example :
1
3
6
10
15......
i tried it i know my code is wrong please help me class Program {
public static void main(String[] args) {
for(int x = 1; x <101; x++) {
int sum = int x;
System.out.println("1");
System.out.println("sum");
}
}
}
3 Votes
11 AnswersI've been trying to make first example program work for about an hour now and I've re-typed it multiple times but it still gives me the same error
ExampleProgram.java:3: error: cannot find symbol
System.out.printIn("Hello World");
And the arrow is pointing at the period (.) after out. Anyone can help me?
0 Votes
7 Answers