sofiadaniela0000
sofiadaniela0000 sofiadaniela0000
  • 17-11-2020
  • Computers and Technology
contestada

JAVA
Use a for loop to print the even numbers between 1 and 50, including the first even number, and the number 50. Print each number on a new line.

Respuesta :

Cytokine
Cytokine Cytokine
  • 17-11-2020

public class JavaApplication65 {

   

   public static void main(String[] args) {

       for (int i = 1; i <= 50; i++){

           if (i % 2 == 0){

               System.out.println(i);

           }

       }

   }

   

}

I hope this helps!

Answer Link

Otras preguntas

Theo owns a bicycle store and wants to attract customers by promoting his Ocean Bike Tour packages. He advertises a discount of $50 off the regular price for e
In the debate leading up to the war of 1812, who were the war hawks
Why did Lincoln wait to announce the emancipation proclamation?
Oak trees make many acorns that can become new oak trees what is this an example of
which caused labor unrest in the united states after world war one
substitute y=-x+6 x-2y=-6
write an addition sentence that has a sun of 20
what is 4/5 in simplest form
(x2 - 5x + 2) + (x2 + 4x + 5) - (x2 - 6x - 42)
why people can us water to generate energy?