0
Using a do while loop write a java program that will display the sum of even numbers from 1-20
Java program
4 Respuestas
+ 9
please show what u did so far.
+ 7
Hello
Your question appears to be homework. Please add your code attempt when asking for help so the community can help you. Here are the 8 rules for getting help. https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community
Thank you
0
Assign x=0, before start of loop,
sum=sum+x; //for adding values
x=x+2; //will give you next even number
Repeat this in loop until x<=20,
Then output result..
Edit:
Good try..
Can you remove dublicate question pls?
- 3
public class program
public static void main( strings [] args) {
do
{
int x=0;
While(x<=20)