Answer the question
In order to leave comments, you need to log in
For loop in Java?
Let me explain the meaning of the problem!
It is necessary to make a task in Java, the essence is as follows:
1. Sum the numbers from 0 to 20
2. Summarize only even numbers from 0 to 20 and odd numbers.
Display larger result
3. If numbers of consecutive numbers need to be added so that their sum is greater than
1000
4. If even/odd numbers must be added to their sum is greater
than 1000
5. Display numbers from 0 to 100 by 4 in each line.
But the problem is that for some unknown reason, an error pops up in the code below (the problem occurs in the line " Sustem.out.println(run);" )
int run;
run = 0;
for (int j=0; j<21; j++)
{
run = run * j;
}
Sustem.out.println(run);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question