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

The change in heat energy for a reaction is best expressed as a change in a. Enthalpy (H) b. Absolute temperature (T) c. Specific heat (c) d. Entropy (S) e
Jerry built a chest shaped like a rectangular solid. The base was 14 inches long and 10 inches wide. It had a height of 4 inches. What is the area of the base
what is 0.6 of 120 really hard and i need an answer for today
what is the square root of 600?
The speed of light is about 3.00 × 105 km/s. It takes approximately 1.28 seconds for light reflected from the moon to reach Earth. What is the average distance
what is the period of the graph of the equation y=3cos2x
The Indus, Ganges, and Brahmaputra were important to ancient India because they were (1) high mountain ranges that protected India from invasion (2) great river
what is the square root of 600?
Wastes are excreted from mollusks via the a. outer shell. b. nerve fibers. c. radula. d. nephridia.
what is the period of the graph of the equation y=3cos2x